Camera: fix null pointer dereference
Test: N/A (no device to repro) Bug: 128569845 Change-Id: Iff13846b6d2d0e9472d8d5b5af256aae1f744535
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user