OSDN Git Service

httplive: fix overflow in BandwidthEstimator
authorRobert Shih <robertshih@google.com>
Mon, 14 Nov 2016 19:23:49 +0000 (11:23 -0800)
committerRobert Shih <robertshih@google.com>
Mon, 14 Nov 2016 19:27:43 +0000 (11:27 -0800)
Bug: 32424616
Change-Id: If857fec44c6466aaadbde8cccbbf95a98d231fa2

media/libstagefright/httplive/LiveSession.cpp

index e24d08d..8e8fa52 100644 (file)
@@ -178,7 +178,7 @@ bool LiveSession::BandwidthEstimator::estimateBandwidth(
         *shortTermBps = mShortTermEstimate;
     }
 
-    int32_t minEstimate = -1, maxEstimate = -1;
+    int64_t minEstimate = -1, maxEstimate = -1;
     List<int32_t>::iterator it;
     for (it = mPrevEstimates.begin(); it != mPrevEstimates.end(); it++) {
         int32_t estimate = *it;