Merge "Camera: fix null pointer dereference" into qt-dev

This commit is contained in:
TreeHugger Robot
2019-04-23 19:37:25 +00:00
committed by Android (Google) Code Review

View File

@@ -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();