summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-06-21 12:13:41 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-06-21 12:13:41 -0700
commitfb6c6167c81c6ade0956d05924eebdeeec65d973 (patch)
tree3ec97f36415918a17177b65c9d579035b0b6616b /media/libstagefright
parent440060f943d9dab6cc5060a6e3159e173d52d9f7 (diff)
parent65a2670e84f44f6cdd80d625a7248fc65319ab8c (diff)
downloadframeworks_av-fb6c6167c81c6ade0956d05924eebdeeec65d973.zip
frameworks_av-fb6c6167c81c6ade0956d05924eebdeeec65d973.tar.gz
frameworks_av-fb6c6167c81c6ade0956d05924eebdeeec65d973.tar.bz2
Merge "Don't assert on malformed .mp4 content that contains fewer samples than"
Diffstat (limited to 'media/libstagefright')
-rw-r--r--media/libstagefright/SampleTable.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/media/libstagefright/SampleTable.cpp b/media/libstagefright/SampleTable.cpp
index eb135ab..a8a094e 100644
--- a/media/libstagefright/SampleTable.cpp
+++ b/media/libstagefright/SampleTable.cpp
@@ -416,12 +416,16 @@ void SampleTable::buildSampleEntriesTable() {
uint32_t delta = mTimeToSample[2 * i + 1];
for (uint32_t j = 0; j < n; ++j) {
- CHECK(sampleIndex < mNumSampleSizes);
+ if (sampleIndex < mNumSampleSizes) {
+ // Technically this should always be the case if the file
+ // is well-formed, but you know... there's (gasp) malformed
+ // content out there.
- mSampleTimeEntries[sampleIndex].mSampleIndex = sampleIndex;
+ mSampleTimeEntries[sampleIndex].mSampleIndex = sampleIndex;
- mSampleTimeEntries[sampleIndex].mCompositionTime =
- sampleTime + getCompositionTimeOffset(sampleIndex);
+ mSampleTimeEntries[sampleIndex].mCompositionTime =
+ sampleTime + getCompositionTimeOffset(sampleIndex);
+ }
++sampleIndex;
sampleTime += delta;