diff options
author | Chong Zhang <chz@google.com> | 2015-05-15 13:40:15 -0700 |
---|---|---|
committer | Chong Zhang <chz@google.com> | 2015-05-15 13:45:56 -0700 |
commit | 5581770ee0dde70e2e9c50533be35e537a5800ef (patch) | |
tree | 568555dda36665dab87c4cc59c688805ca4681c0 /media | |
parent | 51c834c8d321cee50cd07026771e46167a640dd3 (diff) | |
download | frameworks_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')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 4 |
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()); |