diff options
author | SathishKumar Mani <smani@codeaurora.org> | 2015-09-25 18:17:46 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:25:11 -0600 |
commit | 4d0485d7daead3a28cac12c2e2cea25c2ade654d (patch) | |
tree | f491ca8ce40faf88c01b2a043ea70f652c095ebb /media/libstagefright/MPEG4Extractor.cpp | |
parent | 197cd79c6314ac2e14ce94624e21f3c4e38dca7c (diff) | |
download | frameworks_av-4d0485d7daead3a28cac12c2e2cea25c2ade654d.zip frameworks_av-4d0485d7daead3a28cac12c2e2cea25c2ade654d.tar.gz frameworks_av-4d0485d7daead3a28cac12c2e2cea25c2ade654d.tar.bz2 |
Stagefright: Add Checks for allocations
Warn allocation failures explicitly rather than crash
trying to access unallocated memory
Change-Id: Ie86c3ac130917e1f4030eb8207ac8350cba7711d
Diffstat (limited to 'media/libstagefright/MPEG4Extractor.cpp')
-rwxr-xr-x | media/libstagefright/MPEG4Extractor.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp index 84e07b5..cd50365 100755 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -535,6 +535,7 @@ status_t MPEG4Extractor::readMetaData() { } if (psshsize > 0 && psshsize <= UINT32_MAX) { char *buf = (char*)malloc(psshsize); + CHECK(buf != NULL); char *ptr = buf; for (size_t i = 0; i < mPssh.size(); i++) { memcpy(ptr, mPssh[i].uuid, 20); // uuid + length |