summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MPEG4Extractor.cpp
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2011-02-23 17:07:49 -0800
committerJames Dong <jdong@google.com>2011-02-23 17:11:41 -0800
commit17e89b555a41aa591f1a01ecd51a7cb5a7bcfc0e (patch)
tree1f8962490e2d9d7b88e8b2b2806c83849b8ca63b /media/libstagefright/MPEG4Extractor.cpp
parent676ae7591c5260869f89efe2380afaacb79bacc9 (diff)
downloadframeworks_av-17e89b555a41aa591f1a01ecd51a7cb5a7bcfc0e.zip
frameworks_av-17e89b555a41aa591f1a01ecd51a7cb5a7bcfc0e.tar.gz
frameworks_av-17e89b555a41aa591f1a01ecd51a7cb5a7bcfc0e.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/libstagefright/MPEG4Extractor.cpp')
-rw-r--r--media/libstagefright/MPEG4Extractor.cpp21
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;
}