summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2015-08-18 17:07:34 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-18 17:07:34 +0000
commit5d7a381b9c86ff4f00a95063d57ad0a80467799c (patch)
treea2aaa751fe9a7d39666587682be94896e3bd19ac
parent9707195bf18fed1318e5c747db82f9783262a137 (diff)
parent877c76ac42701859fb8185f05c4724a06867fc07 (diff)
downloadframeworks_av-5d7a381b9c86ff4f00a95063d57ad0a80467799c.zip
frameworks_av-5d7a381b9c86ff4f00a95063d57ad0a80467799c.tar.gz
frameworks_av-5d7a381b9c86ff4f00a95063d57ad0a80467799c.tar.bz2
am 877c76ac: Merge "stagefright: check IMemory::pointer() before using the allocation" into klp-dev
* commit '877c76ac42701859fb8185f05c4724a06867fc07': stagefright: check IMemory::pointer() before using the allocation
-rw-r--r--media/libstagefright/ACodec.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 8cece45..67a19cd 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -501,7 +501,9 @@ status_t ACodec::allocateBuffersOnPort(OMX_U32 portIndex) {
for (OMX_U32 i = 0; i < def.nBufferCountActual; ++i) {
sp<IMemory> mem = mDealer[portIndex]->allocate(def.nBufferSize);
- CHECK(mem.get() != NULL);
+ if (mem == NULL || mem->pointer() == NULL) {
+ return NO_MEMORY;
+ }
BufferInfo info;
info.mStatus = BufferInfo::OWNED_BY_US;
@@ -758,7 +760,9 @@ status_t ACodec::allocateOutputMetaDataBuffers() {
sp<IMemory> mem = mDealer[kPortIndexOutput]->allocate(
sizeof(struct VideoDecoderOutputMetaData));
- CHECK(mem.get() != NULL);
+ if (mem == NULL || mem->pointer() == NULL) {
+ return NO_MEMORY;
+ }
info.mData = new ABuffer(mem->pointer(), mem->size());
// we use useBuffer for metadata regardless of quirks