summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua J. Drake <android-open-source@qoop.org>2015-06-10 23:11:23 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-06-10 23:11:23 +0000
commit534ab954aedb19884c56a8b2b55abc6ab7184675 (patch)
tree0b7ea54cddb9058f764fda622304aaef538a2025
parent4bd813f67a286a5efb56d9b3301620a4c37ea435 (diff)
parent10441a6f3066d9ce279c478062a35a7e4e236e73 (diff)
downloadframeworks_av-534ab954aedb19884c56a8b2b55abc6ab7184675.zip
frameworks_av-534ab954aedb19884c56a8b2b55abc6ab7184675.tar.gz
frameworks_av-534ab954aedb19884c56a8b2b55abc6ab7184675.tar.bz2
am 10441a6f: am f02c5c9e: am 4d8ed149: Prevent integer underflow if size is below 6
* commit '10441a6f3066d9ce279c478062a35a7e4e236e73': Prevent integer underflow if size is below 6
-rw-r--r--media/libstagefright/MPEG4Extractor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp
index 9689ce4..58012b2 100644
--- a/media/libstagefright/MPEG4Extractor.cpp
+++ b/media/libstagefright/MPEG4Extractor.cpp
@@ -2471,6 +2471,10 @@ status_t MPEG4Extractor::parse3GPPMetaData(off64_t offset, size_t size, int dept
int len16 = 0; // Number of UTF-16 characters
// smallest possible valid UTF-16 string w BOM: 0xfe 0xff 0x00 0x00
+ if (size < 6) {
+ return ERROR_MALFORMED;
+ }
+
if (size - 6 >= 4) {
len16 = ((size - 6) / 2) - 1; // don't include 0x0000 terminator
framedata = (char16_t *)(buffer + 6);