Skip to content

Commit

Permalink
Bug 1244523: [mp4] P3. Skip four bytes when we hit a zero length box,…
Browse files Browse the repository at this point in the history
… r=kentuckyfriedtakahe

Similar to bug 1180101, but don't handle only the last box in the file.
  • Loading branch information
Jean-Yves Avenard committed Feb 2, 2016
1 parent 846eb88 commit fbeebd3
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (!hdr[0]) {
*offset += 4;
return OK;
}
}
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]);
Expand Down

0 comments on commit fbeebd3

Please sign in to comment.