Skip to content

Commit

Permalink
OMXCodec: check IMemory::pointer() before using allocation
Browse files Browse the repository at this point in the history
CYNGNOS-3235
Bug: 29421811
Change-Id: I0a73ba12bae4122f1d89fc92e5ea4f6a96cd1ed1
(cherry picked from commit 2a14bae)
  • Loading branch information
rjsh authored and Jessica Wagantall committed Sep 12, 2016
1 parent a442cb7 commit 8326655
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion media/libstagefright/OMXCodec.cpp
Expand Up @@ -2108,7 +2108,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;
Expand Down

0 comments on commit 8326655

Please sign in to comment.