Skip to content

Commit 673fa58

Browse files
Wei Jiaandi34
authored andcommitted
MPEG4Extractor: ensure buffer size is not less than 8 for LastCommentData.
Bug: 24346430 Change-Id: I897a724e968841d9160f819d06c0ce22f6d743c4 (cherry picked from commit 5cae16b) (cherry picked from commit e6d904f)
1 parent c9d549f commit 673fa58

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

media/libstagefright/MPEG4Extractor.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,6 +2153,12 @@ status_t MPEG4Extractor::parseMetaData(off64_t offset, size_t size) {
21532153
mLastCommentName.setTo((const char *)buffer + 4);
21542154
break;
21552155
case FOURCC('d', 'a', 't', 'a'):
2156+
if (size < 8) {
2157+
delete[] buffer;
2158+
buffer = NULL;
2159+
ALOGE("b/24346430");
2160+
return ERROR_MALFORMED;
2161+
}
21562162
mLastCommentData.setTo((const char *)buffer + 8);
21572163
break;
21582164
}

0 commit comments

Comments
 (0)