Bug 1093567 - Don't loop forever looking for mp4 tracks. r=ajones.

We were ignoring I/O errors from parseChunk().
We must break instead of returning early so mInitCheck gets set correctly.
This commit is contained in:
Ralph Giles 2014-11-17 16:20:00 -08:00
parent f84588fdfb
commit e959e5f83a
2 changed files with 9 additions and 0 deletions

View File

@ -1669,6 +1669,7 @@ MediaCache::NoteSeek(MediaCacheStream* aStream, int64_t aOldOffset)
std::min<int64_t>((aOldOffset + BLOCK_SIZE - 1)/BLOCK_SIZE,
aStream->mBlocks.Length());
while (blockIndex < endIndex) {
MOZ_ASSERT(endIndex > 0);
int32_t cacheBlockIndex = aStream->mBlocks[endIndex - 1];
if (cacheBlockIndex >= 0) {
BlockOwner* bo = GetBlockOwner(cacheBlockIndex, aStream);

View File

@ -464,6 +464,14 @@ status_t MPEG4Extractor::readMetaData() {
status_t err;
while (!mFirstTrack) {
err = parseChunk(&offset, 0);
// The parseChunk function returns UNKNOWN_ERROR to skip
// some boxes we don't want to handle. Filter that error
// code but return others so e.g. I/O errors propagate.
if (err != OK && err != (status_t) UNKNOWN_ERROR) {
ALOGW("Error %d parsing chuck at offset %lld looking for first track",
err, (long long)offset);
break;
}
}
if (mInitCheck == OK) {