diff options
author | Marco Nelissen <marcone@google.com> | 2015-10-06 20:05:28 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-10-06 20:05:28 +0000 |
commit | f2cf2bd7448734c6881e3bea2b758f2bf9feeed9 (patch) | |
tree | 87f58dc0826ba1a884bcb8aae9b33010c6b84a4b | |
parent | 62d89908f6c7e3da9dac36aa439ceb1c2522b86d (diff) | |
parent | 07395f4cd72cf29d1de2864cde42876db4e54411 (diff) | |
download | frameworks_av-f2cf2bd7448734c6881e3bea2b758f2bf9feeed9.zip frameworks_av-f2cf2bd7448734c6881e3bea2b758f2bf9feeed9.tar.gz frameworks_av-f2cf2bd7448734c6881e3bea2b758f2bf9feeed9.tar.bz2 |
am 07395f4c: am 00f5fa82: am 74d1927e: Merge "Check NAL size before use" into klp-dev
* commit '07395f4cd72cf29d1de2864cde42876db4e54411':
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 d9975bb..b757f94 100644 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -3897,7 +3897,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(); @@ -4184,7 +4187,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(); |