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

Commit 3ef060ef authored by Yin-Chia Yeh's avatar Yin-Chia Yeh
Browse files

Camera: fix null pointer dereference

Test: N/A (no device to repro)
Bug: 128569845
Change-Id: Iff13846b6d2d0e9472d8d5b5af256aae1f744535
parent 0cae8391
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -256,6 +256,10 @@ void JNICameraContext::copyAndPost(JNIEnv* env, const sp<IMemory>& dataPtr, int
        ssize_t offset;
        size_t size;
        sp<IMemoryHeap> heap = dataPtr->getMemory(&offset, &size);
        if (heap == NULL) {
            ALOGV("copyAndPost: skipping null memory callback!");
            return;
        }
        ALOGV("copyAndPost: off=%zd, size=%zu", offset, size);
        uint8_t *heapBase = (uint8_t*)heap->base();