summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2015-05-15 13:40:15 -0700
committerChong Zhang <chz@google.com>2015-05-15 13:45:56 -0700
commit5581770ee0dde70e2e9c50533be35e537a5800ef (patch)
tree568555dda36665dab87c4cc59c688805ca4681c0 /media/libstagefright/ACodec.cpp
parent51c834c8d321cee50cd07026771e46167a640dd3 (diff)
downloadframeworks_av-5581770ee0dde70e2e9c50533be35e537a5800ef.zip
frameworks_av-5581770ee0dde70e2e9c50533be35e537a5800ef.tar.gz
frameworks_av-5581770ee0dde70e2e9c50533be35e537a5800ef.tar.bz2
stagefright: check IMemory::pointer() before using the allocation
bug: 19779574 Change-Id: I4ffe8c3fadc07da211f421e75ee83010b01d9cbb
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 3db4a58..34bd4c7 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -698,7 +698,7 @@ status_t ACodec::allocateBuffersOnPort(OMX_U32 portIndex) {
for (OMX_U32 i = 0; i < def.nBufferCountActual; ++i) {
sp<IMemory> mem = mDealer[portIndex]->allocate(def.nBufferSize);
- if (mem.get() == NULL) {
+ if (mem == NULL || mem->pointer() == NULL) {
return NO_MEMORY;
}
@@ -990,7 +990,7 @@ status_t ACodec::allocateOutputMetaDataBuffers() {
sp<IMemory> mem = mDealer[kPortIndexOutput]->allocate(
sizeof(struct VideoDecoderOutputMetaData));
- if (mem.get() == NULL) {
+ if (mem == NULL || mem->pointer() == NULL) {
return NO_MEMORY;
}
info.mData = new ABuffer(mem->pointer(), mem->size());