Bug 1244523: [mp4] P3. Skip four bytes when we hit a zero length box, r=kentuckyfriedtakahe

Similar to bug 1180101, but don't handle only the last box in the file.
This commit is contained in:
Jean-Yves Avenard 2016-02-02 11:38:53 +11:00
parent 91b04a5c80
commit 3c49e87858

View File

@ -651,14 +651,14 @@ static bool ValidInputSize(int32_t size) {
status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {
ALOGV("entering parseChunk %lld/%d", *offset, depth);
uint32_t hdr[2];
ssize_t nbytes;
if ((nbytes = mDataSource->readAt(*offset, hdr, 8)) < 8) {
if (nbytes == 4) {
if (mDataSource->readAt(*offset, hdr, 4) < 4) {
return ERROR_IO;
}
if (!hdr[0]) {
*offset += 4;
return OK;
}
}
if (mDataSource->readAt(*offset + 4, hdr + 1, 4) < 4) {
return ERROR_IO;
}
uint64_t chunk_size = ntohl(hdr[0]);