summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJoshua J. Drake <android-open-source@qoop.org>2015-08-07 16:11:05 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-07 16:11:05 +0000
commitbb99a362dc76f9bf040f6256369fabf27ad1c2f5 (patch)
tree766c013eefdeb28e1fb769b25f50c96603d28d89 /media
parent430475da7f0edb86ee6a85378d1583ab07f7f93d (diff)
parent8d60fc3e3ecd4d7c2b18f25962f0ea42f3644ebd (diff)
downloadframeworks_av-bb99a362dc76f9bf040f6256369fabf27ad1c2f5.zip
frameworks_av-bb99a362dc76f9bf040f6256369fabf27ad1c2f5.tar.gz
frameworks_av-bb99a362dc76f9bf040f6256369fabf27ad1c2f5.tar.bz2
am 8d60fc3e: am 338bbf53: am fd334e34: am 03d539a7: am a5b9055d: am f1ce97dd: Fix integer overflow when handling MPEG4 tx3g atom
* commit '8d60fc3e3ecd4d7c2b18f25962f0ea42f3644ebd': Fix integer overflow when handling MPEG4 tx3g atom
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/MPEG4Extractor.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp
index 613be93..b51f40e 100644
--- a/media/libstagefright/MPEG4Extractor.cpp
+++ b/media/libstagefright/MPEG4Extractor.cpp
@@ -1396,7 +1396,14 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {
size = 0;
}
+ if (SIZE_MAX - chunk_size <= size) {
+ return ERROR_MALFORMED;
+ }
+
uint8_t *buffer = new uint8_t[size + chunk_size];
+ if (buffer == NULL) {
+ return ERROR_MALFORMED;
+ }
if (size > 0) {
memcpy(buffer, data, size);