diff options
author | Marco Nelissen <marcone@google.com> | 2016-01-12 23:10:24 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-01-12 23:10:24 +0000 |
commit | e463301aa44f0ea0ae1a2399bf8800d94cf6ce3e (patch) | |
tree | 1f580e41c5669a809a5eb7fa4fc0b7aa63b50a7c /media | |
parent | a1cba19136a272e5621f993b70a15f9a1d66aafd (diff) | |
parent | a39f9818759155a2651995d6844f9821d83e3f0d (diff) | |
download | frameworks_av-e463301aa44f0ea0ae1a2399bf8800d94cf6ce3e.zip frameworks_av-e463301aa44f0ea0ae1a2399bf8800d94cf6ce3e.tar.gz frameworks_av-e463301aa44f0ea0ae1a2399bf8800d94cf6ce3e.tar.bz2 |
Fix out-of-bounds write am: 5403587a74 am: fb2eb86102 am: e6bd186c7e am: a8ac8f617b am: e2e46f5fa1 am: 2304c606eb am: 0945199000
am: a39f981875
* commit 'a39f9818759155a2651995d6844f9821d83e3f0d':
Fix out-of-bounds write
Diffstat (limited to 'media')
-rwxr-xr-x | media/libstagefright/MPEG4Extractor.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp index bfdff38..e4f8384 100755 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -4545,7 +4545,15 @@ status_t MPEG4Source::fragmentedRead( continue; } - CHECK(dstOffset + 4 <= mBuffer->size()); + if (dstOffset > SIZE_MAX - 4 || + dstOffset + 4 > SIZE_MAX - nalLength || + dstOffset + 4 + nalLength > mBuffer->size()) { + ALOGE("b/26365349 : %zu %zu", dstOffset, mBuffer->size()); + android_errorWriteLog(0x534e4554, "26365349"); + mBuffer->release(); + mBuffer = NULL; + return ERROR_MALFORMED; + } dstData[dstOffset++] = 0; dstData[dstOffset++] = 0; |