Merge "Fix divide by zero" am: 659cb35e19 am: 021add2def
am: 6fe7d5973c
Change-Id: I05b15bf43fb31d9de3560ca1ccfe0c93f29fcf8f
diff --git a/media/libstagefright/SampleIterator.cpp b/media/libstagefright/SampleIterator.cpp
index 8ddf7f3..4134698 100644
--- a/media/libstagefright/SampleIterator.cpp
+++ b/media/libstagefright/SampleIterator.cpp
@@ -313,7 +313,7 @@
break;
}
if (mTimeToSampleIndex == mTable->mTimeToSampleCount ||
- mTTSCount > UINT32_MAX / mTTSDuration ||
+ (mTTSDuration != 0 && mTTSCount > UINT32_MAX / mTTSDuration) ||
mTTSSampleTime > UINT32_MAX - (mTTSCount * mTTSDuration)) {
return ERROR_OUT_OF_RANGE;
}