summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2015-08-07 11:19:24 -0700
committerAbhisek Devkota <ciwrl@cyanogenmod.com>2015-08-13 12:31:34 -0700
commit2af9bb1b115f152fd41f0f9d0cfd8420a700bb1a (patch)
treeeebd4df8b67ef0d62bf4af485586c38ed6b7f742
parent7b15dd429177147e02b335a50dd887bc5c2524b4 (diff)
downloadframeworks_av-cm-10.2.tar.gz
frameworks_av-cm-10.2.tar.bz2
frameworks_av-cm-10.2.zip
MPEG4Extractor.cpp: handle chunk_size > SIZE_MAXcm-10.2
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.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp
index 5620b4ffeb..72ec476732 100644
--- a/media/libstagefright/MPEG4Extractor.cpp
+++ b/media/libstagefright/MPEG4Extractor.cpp
@@ -1823,7 +1823,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;
}