Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 641d56b1 authored by Chong Zhang's avatar Chong Zhang Committed by Android (Google) Code Review
Browse files

Merge "stagefright: check IMemory::pointer() before using the allocation" into mnc-dev

parents 89cf8946 5581770e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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());