Bug 1171067: Part2. Properly hande box size marked as 0. r=kentuckyfriedtakahe

This indicates that the box goes to the end of the file.
This commit is contained in:
Jean-Yves Avenard 2015-06-10 19:38:13 +10:00
parent a91eb477eb
commit 9b86221a9f

View File

@ -78,6 +78,10 @@ Box::Box(BoxContext* aContext, uint64_t aOffset, const Box* aParent)
}
size = BigEndian::readUint64(bigLength);
mBodyOffset = bigLengthRange.mEnd;
} else if (size == 0) {
// box extends to end of file.
size = mContext->mByteRanges.LastElement().mEnd - aOffset;
mBodyOffset = headerRange.mEnd;
} else {
mBodyOffset = headerRange.mEnd;
}