am f7ec627f: am 1127e1b6: Merge "Fix benign overflow in getTimeUsOfGranule"
* commit 'f7ec627f451abbd17ee0c2cb57e07700cf671f2f':
Fix benign overflow in getTimeUsOfGranule
diff --git a/media/libstagefright/OggExtractor.cpp b/media/libstagefright/OggExtractor.cpp
index b7e24ef..c216b53 100644
--- a/media/libstagefright/OggExtractor.cpp
+++ b/media/libstagefright/OggExtractor.cpp
@@ -179,6 +179,9 @@
protected:
virtual int64_t getTimeUsOfGranule(uint64_t granulePos) const {
+ if (granulePos > INT64_MAX / 1000000ll) {
+ return INT64_MAX;
+ }
return granulePos * 1000000ll / mVi.rate;
}
@@ -922,6 +925,9 @@
if (granulePos > mCodecDelay) {
pcmSamplePosition = granulePos - mCodecDelay;
}
+ if (pcmSamplePosition > INT64_MAX / 1000000ll) {
+ return INT64_MAX;
+ }
return pcmSamplePosition * 1000000ll / kOpusSampleRate;
}