diff options
author | Marco Nelissen <marcone@google.com> | 2015-10-06 20:24:45 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-10-06 20:24:45 +0000 |
commit | f1790258494751adc629126666e7dd81bbc8afbd (patch) | |
tree | d96e3ae02d9d87f207686a5ea8ab21c6fbfc7e8a | |
parent | b8f5d50cd652b4ff6121b9107b5dd7d91ca5929e (diff) | |
parent | 5e92fdede2391b77cff5fe914d748e1023d0ef90 (diff) | |
download | frameworks_av-f1790258494751adc629126666e7dd81bbc8afbd.zip frameworks_av-f1790258494751adc629126666e7dd81bbc8afbd.tar.gz frameworks_av-f1790258494751adc629126666e7dd81bbc8afbd.tar.bz2 |
am 5e92fded: am 64cdd5f2: am f2cf2bd7: am 07395f4c: am 00f5fa82: am 74d1927e: Merge "Check NAL size before use" into klp-dev
* commit '5e92fdede2391b77cff5fe914d748e1023d0ef90':
Check NAL size before use
-rw-r--r-- | media/libstagefright/MPEG4Extractor.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp index 96423e6..92cc771 100644 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -3910,7 +3910,10 @@ status_t MPEG4Source::read( (const uint8_t *)mBuffer->data() + mBuffer->range_offset(); size_t nal_size = parseNALSize(src); - if (mBuffer->range_length() < mNALLengthSize + nal_size) { + if (mNALLengthSize > SIZE_MAX - nal_size) { + ALOGE("b/24441553, b/24445122"); + } + if (mBuffer->range_length() - mNALLengthSize < nal_size) { ALOGE("incomplete NAL unit."); mBuffer->release(); @@ -4197,7 +4200,11 @@ status_t MPEG4Source::fragmentedRead( (const uint8_t *)mBuffer->data() + mBuffer->range_offset(); size_t nal_size = parseNALSize(src); - if (mBuffer->range_length() < mNALLengthSize + nal_size) { + if (mNALLengthSize > SIZE_MAX - nal_size) { + ALOGE("b/24441553, b/24445122"); + } + + if (mBuffer->range_length() - mNALLengthSize < nal_size) { ALOGE("incomplete NAL unit."); mBuffer->release(); |