summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyszard Grzesica <ryszard.grzesica@sonymobile.com>2015-12-29 06:28:44 +0100
committerMSe <mse1969@posteo.de>2018-06-08 19:33:02 +0200
commitc81197623a895ae05354b4ad713066ab63978b81 (patch)
tree5367e783e524dca0376b4d2cf5d6d023d37c3cae
parent33b6a0d4e2ce158fee4241985cfca3b959ec99a7 (diff)
downloadframeworks_av-c81197623a895ae05354b4ad713066ab63978b81.tar.gz
frameworks_av-c81197623a895ae05354b4ad713066ab63978b81.tar.bz2
frameworks_av-c81197623a895ae05354b4ad713066ab63978b81.zip
Add check preventing div0 issue
There might be a scenario while period is zero or after including precision would be zero, prevent from division in that case and return false (to use previously used period). Bug: 73898703 bug: 74067957 Test: run playback as stability test Change-Id: I3fad1060b095b7b5ea4c1f9cb3f9d42a4c503560 (cherry picked from commit 27e47ce3c3bbc0b4dc629163de7ebbba7e80b149) CVE-2018-9354
-rw-r--r--media/libstagefright/VideoFrameScheduler.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/media/libstagefright/VideoFrameScheduler.cpp b/media/libstagefright/VideoFrameScheduler.cpp
index c17faf32d8..b2d12f4da9 100644
--- a/media/libstagefright/VideoFrameScheduler.cpp
+++ b/media/libstagefright/VideoFrameScheduler.cpp
@@ -129,6 +129,11 @@ bool VideoFrameScheduler::PLL::fit(
numSamplesToUse = mNumSamples;
}
+ if ((period >> kPrecision) == 0 ) {
+ ALOGW("Period is 0, or after including precision is 0 - would cause div0, returning");
+ return false;
+ }
+
int64_t sumX = 0;
int64_t sumXX = 0;
int64_t sumXY = 0;