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

Commit b03c5db9 authored by Robert Shih's avatar Robert Shih
Browse files

LiveSession: fix getBandwidthIndex mul overflow

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