diff options
author | Nick Kralevich <nnk@google.com> | 2015-08-07 11:19:24 -0700 |
---|---|---|
committer | Abhisek Devkota <ciwrl@cyanogenmod.com> | 2015-08-13 12:30:57 -0700 |
commit | b427a7eb9580ca965ec12340120b5d04cffc7b6a (patch) | |
tree | c692104da8e832619b521f4d0a34a5904349ea33 | |
parent | fa7a54848a50d587be90210c317f7885927ff7f7 (diff) | |
download | frameworks_av-cm-10.1.tar.gz frameworks_av-cm-10.1.tar.bz2 frameworks_av-cm-10.1.zip |
MPEG4Extractor.cpp: handle chunk_size > SIZE_MAXcm-10.1
chunk_size is a uint64_t, so it can legitimately be bigger
than SIZE_MAX, which would cause the subtraction to underflow.
https://code.google.com/p/android/issues/detail?id=182251
Bug: 23034759
Change-Id: Ic1637fb26bf6edb0feb1bcf2876fd370db1ed547
-rw-r--r-- | media/libstagefright/MPEG4Extractor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp index 4167828044..a71bc406d3 100644 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -1459,7 +1459,7 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { size = 0; } - if (SIZE_MAX - chunk_size <= size) { + if ((chunk_size > SIZE_MAX) || (SIZE_MAX - chunk_size <= size)) { return ERROR_MALFORMED; } |