diff options
| author | Andreas Huber <andih@google.com> | 2010-06-24 13:16:47 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2010-06-24 13:16:47 -0700 |
| commit | 95d26de9e048ef0342e3aed15a4d5d5c8a6e8493 (patch) | |
| tree | 0dc287c7b97afed345e1f0caebdc3d205dae6695 | |
| parent | 82677b9585968806800abff65c5b1529f509a313 (diff) | |
| parent | 7b5b27ada12d3680dec20274fa655fd7f73f839e (diff) | |
| download | frameworks_base-95d26de9e048ef0342e3aed15a4d5d5c8a6e8493.zip frameworks_base-95d26de9e048ef0342e3aed15a4d5d5c8a6e8493.tar.gz frameworks_base-95d26de9e048ef0342e3aed15a4d5d5c8a6e8493.tar.bz2 | |
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.
| -rw-r--r-- | media/libstagefright/MPEG4Extractor.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp index 3639db4..0c2f1e6 100644 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -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]; |
