summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2016-07-12 18:00:53 -0700
committergitbuildkicker <android-build@google.com>2016-08-16 15:51:49 -0700
commited4f365e8b158934937ad0a2e14ede566923bc33 (patch)
tree63521cb7b7a54a01b5af1632495fce153d87b36f /media/libstagefright
parente9ef8505a1a33667ef97b752f77190c24b468015 (diff)
downloadframeworks_av-ed4f365e8b158934937ad0a2e14ede566923bc33.zip
frameworks_av-ed4f365e8b158934937ad0a2e14ede566923bc33.tar.gz
frameworks_av-ed4f365e8b158934937ad0a2e14ede566923bc33.tar.bz2
OMXCodec: check IMemory::pointer() before using allocation
Bug: 29421811 Change-Id: I0a73ba12bae4122f1d89fc92e5ea4f6a96cd1ed1
Diffstat (limited to 'media/libstagefright')
-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;