summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/SampleTable.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-06-21 11:38:01 -0700
committerAndreas Huber <andih@google.com>2011-06-21 11:38:01 -0700
commit65a2670e84f44f6cdd80d625a7248fc65319ab8c (patch)
treec13a13485e4e741ca0a4b511f9dd748b5cf3daae /media/libstagefright/SampleTable.cpp
parent551e95607ce83c0d491a2c12cdae4aa92197dc2c (diff)
downloadframeworks_av-65a2670e84f44f6cdd80d625a7248fc65319ab8c.zip
frameworks_av-65a2670e84f44f6cdd80d625a7248fc65319ab8c.tar.gz
frameworks_av-65a2670e84f44f6cdd80d625a7248fc65319ab8c.tar.bz2
Don't assert on malformed .mp4 content that contains fewer samples than
described in the time-to-sample box. Change-Id: Ic6f973212c15012a25f6e849759fd4f14d97e30f related-to-bug: 4779053
Diffstat (limited to 'media/libstagefright/SampleTable.cpp')
-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;