diff options
author | James Dong <jdong@google.com> | 2011-02-23 17:07:49 -0800 |
---|---|---|
committer | James Dong <jdong@google.com> | 2011-02-23 17:11:41 -0800 |
commit | bc5f1f5c815e6a158859c031fa7bb0fd68d973b9 (patch) | |
tree | fbfa4fdba6d5fa905daced82d9013fcc6a5fbc6d /media | |
parent | 75a03f9a3c142f935f6242822ebe66e21f2c56fd (diff) | |
download | frameworks_base-bc5f1f5c815e6a158859c031fa7bb0fd68d973b9.zip frameworks_base-bc5f1f5c815e6a158859c031fa7bb0fd68d973b9.tar.gz frameworks_base-bc5f1f5c815e6a158859c031fa7bb0fd68d973b9.tar.bz2 |
d263 may contain optional bitr box, and thus its size can be up to 23 bytes
bug - 3482703
Change-Id: Id6fdf9d1f4a304954c018b67d50bd79a07164687
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/MPEG4Extractor.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp index a973d7e..cf4cbe5 100644 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -1166,13 +1166,20 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { case FOURCC('d', '2', '6', '3'): { - // d263 contains fixed 7 bytes: - // vendor - 4 bytes - // version - 1 byte - // level - 1 byte - // profile - 1 byte - char buffer[7]; - if (chunk_data_size != (off64_t) sizeof(buffer)) { + /* + * d263 contains a fixed 7 bytes part: + * vendor - 4 bytes + * version - 1 byte + * level - 1 byte + * profile - 1 byte + * optionally, "d263" box itself may contain a 16-byte + * bit rate box (bitr) + * average bit rate - 4 bytes + * max bit rate - 4 bytes + */ + char buffer[23]; + if (chunk_data_size != 7 && + chunk_data_size != 23) { LOGE("Incorrect D263 box size %lld", chunk_data_size); return ERROR_MALFORMED; } |