Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca4cd816 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "LiveSession: fix getBandwidthIndex mul overflow" into qt-dev

parents b7a422ad b03c5db9
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1384,7 +1384,7 @@ size_t LiveSession::getBandwidthIndex(int32_t bandwidthBps) {
        while (index > lowestBandwidth) {
        while (index > lowestBandwidth) {
            // be conservative (70%) to avoid overestimating and immediately
            // be conservative (70%) to avoid overestimating and immediately
            // switching down again.
            // switching down again.
            size_t adjustedBandwidthBps = bandwidthBps * 7 / 10;
            size_t adjustedBandwidthBps = bandwidthBps * .7f;
            const BandwidthItem &item = mBandwidthItems[index];
            const BandwidthItem &item = mBandwidthItems[index];
            if (item.mBandwidth <= adjustedBandwidthBps
            if (item.mBandwidth <= adjustedBandwidthBps
                    && isBandwidthValid(item)) {
                    && isBandwidthValid(item)) {