diff options
author | Marco Nelissen <marcone@google.com> | 2015-10-06 20:11:47 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-10-06 20:11:47 +0000 |
commit | 64cdd5f243ffdb9460ae3d17bd2a732560fc8395 (patch) | |
tree | 04d6b4c67268af1badb84cf9d6925bfca7dafcc4 | |
parent | fb0d63df2393a5e20cbb16d90ed5c01295a81836 (diff) | |
parent | f2cf2bd7448734c6881e3bea2b758f2bf9feeed9 (diff) | |
download | frameworks_av-64cdd5f243ffdb9460ae3d17bd2a732560fc8395.zip frameworks_av-64cdd5f243ffdb9460ae3d17bd2a732560fc8395.tar.gz frameworks_av-64cdd5f243ffdb9460ae3d17bd2a732560fc8395.tar.bz2 |
am f2cf2bd7: am 07395f4c: am 00f5fa82: am 74d1927e: Merge "Check NAL size before use" into klp-dev
* commit 'f2cf2bd7448734c6881e3bea2b758f2bf9feeed9':
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 69eab99..7d7cf07 100644 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -3900,7 +3900,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(); @@ -4187,7 +4190,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(); |