diff options
author | Andreas Huber <andih@google.com> | 2011-10-06 09:07:12 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2011-10-06 09:07:12 -0700 |
commit | 90ba107fcf36ce6df111a594b2cc27163b36793d (patch) | |
tree | 68a137efdd26cfea3b2846403ae88dd86ace23ac /media | |
parent | 94d2f366f971bc052da9856e9f8867094e738cd1 (diff) | |
download | frameworks_base-90ba107fcf36ce6df111a594b2cc27163b36793d.zip frameworks_base-90ba107fcf36ce6df111a594b2cc27163b36793d.tar.gz frameworks_base-90ba107fcf36ce6df111a594b2cc27163b36793d.tar.bz2 |
Return a runtime error instead of assertion if seeking beyond EOS in mpeg4 files.
Change-Id: If6531b4a1ff45460cfcdcc04764c5c63a2f5a749
related-to-bug: 5418914
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/MPEG4Extractor.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp index 3b79f06..1e24599 100644 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -1972,6 +1972,12 @@ status_t MPEG4Source::read( sampleIndex, &syncSampleIndex, findFlags); } + uint32_t sampleTime; + if (err == OK) { + err = mSampleTable->getMetaDataForSample( + sampleIndex, NULL, NULL, &sampleTime); + } + if (err != OK) { if (err == ERROR_OUT_OF_RANGE) { // An attempt to seek past the end of the stream would @@ -1984,10 +1990,6 @@ status_t MPEG4Source::read( return err; } - uint32_t sampleTime; - CHECK_EQ((status_t)OK, mSampleTable->getMetaDataForSample( - sampleIndex, NULL, NULL, &sampleTime)); - if (mode == ReadOptions::SEEK_CLOSEST) { targetSampleTimeUs = (sampleTime * 1000000ll) / mTimescale; } |