diff options
author | Marco Nelissen <marcone@google.com> | 2016-01-12 23:08:10 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-01-12 23:08:10 +0000 |
commit | a39f9818759155a2651995d6844f9821d83e3f0d (patch) | |
tree | a45b5e93d0d1c525e4a4971a3d58970b5ad9a90d /media | |
parent | cf2f811d7586cb48d261d44fc3e62b67de8f30ff (diff) | |
parent | 0945199000aaa5a628705de69f17d28a5c04cc36 (diff) | |
download | frameworks_av-a39f9818759155a2651995d6844f9821d83e3f0d.zip frameworks_av-a39f9818759155a2651995d6844f9821d83e3f0d.tar.gz frameworks_av-a39f9818759155a2651995d6844f9821d83e3f0d.tar.bz2 |
Fix out-of-bounds write am: 5403587a74 am: fb2eb86102 am: e6bd186c7e am: a8ac8f617b am: e2e46f5fa1 am: 2304c606eb
am: 0945199000
* commit '0945199000aaa5a628705de69f17d28a5c04cc36':
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 a1af3aa..f2d30b3 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; |