summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 16ff80b..008c410 100644
--- a/media/libstagefright/MPEG4Extractor.cpp
+++ b/media/libstagefright/MPEG4Extractor.cpp
@@ -1538,7 +1538,7 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {
ALOGV("chunk_data_size = %lld and data_offset = %lld",
(long long)chunk_data_size, (long long)data_offset);
- if (chunk_data_size >= SIZE_MAX - 1) {
+ if (chunk_data_size < 0 || static_cast<uint64_t>(chunk_data_size) >= SIZE_MAX - 1) {
return ERROR_MALFORMED;
}
uint8_t *buffer = new uint8_t[chunk_data_size + 1];