Skip to content

Commit beedd86

Browse files
theandi666Android (Google) Code Review
authored andcommitted
Merge "Return a runtime error instead of assertion if seeking beyond EOS in mpeg4 files."
2 parents 3475ebf + 90ba107 commit beedd86

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

media/libstagefright/MPEG4Extractor.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,6 +1972,12 @@ status_t MPEG4Source::read(
19721972
sampleIndex, &syncSampleIndex, findFlags);
19731973
}
19741974

1975+
uint32_t sampleTime;
1976+
if (err == OK) {
1977+
err = mSampleTable->getMetaDataForSample(
1978+
sampleIndex, NULL, NULL, &sampleTime);
1979+
}
1980+
19751981
if (err != OK) {
19761982
if (err == ERROR_OUT_OF_RANGE) {
19771983
// An attempt to seek past the end of the stream would
@@ -1984,10 +1990,6 @@ status_t MPEG4Source::read(
19841990
return err;
19851991
}
19861992

1987-
uint32_t sampleTime;
1988-
CHECK_EQ((status_t)OK, mSampleTable->getMetaDataForSample(
1989-
sampleIndex, NULL, NULL, &sampleTime));
1990-
19911993
if (mode == ReadOptions::SEEK_CLOSEST) {
19921994
targetSampleTimeUs = (sampleTime * 1000000ll) / mTimescale;
19931995
}

0 commit comments

Comments
 (0)