summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2016-07-12 18:00:53 -0700
committergitbuildkicker <android-build@google.com>2016-07-21 17:29:23 -0700
commit97837bb6cbac21ea679843a0037779d3834bed64 (patch)
tree2ced355e96f4387a8b36e68da9f3d8ae10aaeb50 /media
parentf9391b39b1f0c98191ad3fff1a54b5f26e954421 (diff)
downloadframeworks_av-97837bb6cbac21ea679843a0037779d3834bed64.zip
frameworks_av-97837bb6cbac21ea679843a0037779d3834bed64.tar.gz
frameworks_av-97837bb6cbac21ea679843a0037779d3834bed64.tar.bz2
OMXCodec: check IMemory::pointer() before using allocation
Bug: 29421811 Change-Id: I0a73ba12bae4122f1d89fc92e5ea4f6a96cd1ed1
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/OMXCodec.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 4618e21..7e15e18 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -1622,7 +1622,9 @@ status_t OMXCodec::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.mData = NULL;