diff options
author | Marco Nelissen <marcone@google.com> | 2015-10-06 21:25:01 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-10-06 21:25:01 +0000 |
commit | bf42e44c04ca08394a98eb8dda9ae8f9096dd396 (patch) | |
tree | bb78e6c20e2ddc9844c18c2cb0e5fb8a9a9b09f2 /media/libstagefright | |
parent | 6b42757eb0c1ed942379f8829d299865b94a68ed (diff) | |
parent | 6f14568be83995a0ee0104f521f93e1e4d9902f3 (diff) | |
download | frameworks_av-bf42e44c04ca08394a98eb8dda9ae8f9096dd396.zip frameworks_av-bf42e44c04ca08394a98eb8dda9ae8f9096dd396.tar.gz frameworks_av-bf42e44c04ca08394a98eb8dda9ae8f9096dd396.tar.bz2 |
am 6f14568b: am f1790258: am 5e92fded: am 64cdd5f2: am f2cf2bd7: am 07395f4c: am 00f5fa82: am 74d1927e: Merge "Check NAL size before use" into klp-dev
* commit '6f14568be83995a0ee0104f521f93e1e4d9902f3':
Check NAL size before use
Diffstat (limited to 'media/libstagefright')
-rwxr-xr-x | 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 4e12c07..a1af3aa 100755 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -4150,7 +4150,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(); @@ -4437,7 +4440,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(); |