Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

frameworks-av: Commit

frameworks/av


Commit MetaInfo

Revision0182a2cba07494de4d530ef1c346cf572c83ecc1 (tree)
Time2018-05-26 03:38:53
AuthorRyszard Grzesica <ryszard.grzesica@sony...>
Commiterandroid-build-team Robot

Log Message

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)

Change Summary

Incremental Difference

--- a/media/libstagefright/VideoFrameScheduler.cpp
+++ b/media/libstagefright/VideoFrameScheduler.cpp
@@ -129,6 +129,11 @@ bool VideoFrameScheduler::PLL::fit(
129129 numSamplesToUse = mNumSamples;
130130 }
131131
132+ if ((period >> kPrecision) == 0 ) {
133+ ALOGW("Period is 0, or after including precision is 0 - would cause div0, returning");
134+ return false;
135+ }
136+
132137 int64_t sumX = 0;
133138 int64_t sumXX = 0;
134139 int64_t sumXY = 0;
Show on old repository browser