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

am: dc7de27113

Change-Id: Ifcd0da978fe11f873e07310ef2513b87ba3415a8
This commit is contained in:
Yin-Chia Yeh
2019-04-23 13:40:33 -07:00
committed by android-build-merger

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