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

Commit d1884052 authored by Chong Zhang's avatar Chong Zhang Committed by Android Git Automerger
Browse files

am bfadec12: am 25c00122: am 4ce86e78: am 5d7a381b: am 877c76ac: Merge...

am bfadec12: am 25c00122: am 4ce86e78: am 5d7a381b: am 877c76ac: Merge "stagefright: check IMemory::pointer() before using the allocation" into klp-dev

* commit 'bfadec12':
  stagefright: check IMemory::pointer() before using the allocation
parents 9e01d68b bfadec12
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -553,7 +553,9 @@ status_t ACodec::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.mStatus = BufferInfo::OWNED_BY_US;
@@ -880,7 +882,9 @@ status_t ACodec::allocateOutputMetaDataBuffers() {

        sp<IMemory> mem = mDealer[kPortIndexOutput]->allocate(
                sizeof(struct VideoDecoderOutputMetaData));
        CHECK(mem.get() != NULL);
        if (mem == NULL || mem->pointer() == NULL) {
            return NO_MEMORY;
        }
        info.mData = new ABuffer(mem->pointer(), mem->size());

        // we use useBuffer for metadata regardless of quirks