am 7b5b27ad: Merge "Properly identify malformed (too short) chunks in mpeg4 files." into gingerbread

Merge commit '7b5b27ada12d3680dec20274fa655fd7f73f839e' into gingerbread-plus-aosp

* commit '7b5b27ada12d3680dec20274fa655fd7f73f839e':
  Properly identify malformed (too short) chunks in mpeg4 files.
This commit is contained in:
Andreas Huber
2010-06-24 13:16:47 -07:00
committed by Android Git Automerger

View File

@@ -428,6 +428,14 @@ status_t MPEG4Extractor::parseChunk(off_t *offset, int depth) {
}
chunk_size = ntoh64(chunk_size);
data_offset += 8;
if (chunk_size < 16) {
// The smallest valid chunk is 16 bytes long in this case.
return ERROR_MALFORMED;
}
} else if (chunk_size < 8) {
// The smallest valid chunk is 8 bytes long.
return ERROR_MALFORMED;
}
char chunk[5];