diff options
Diffstat (limited to 'services/camera/libcameraservice/CameraHardwareInterface.h')
-rw-r--r-- | services/camera/libcameraservice/CameraHardwareInterface.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/services/camera/libcameraservice/CameraHardwareInterface.h b/services/camera/libcameraservice/CameraHardwareInterface.h index c3ced4c2..57f923f 100644 --- a/services/camera/libcameraservice/CameraHardwareInterface.h +++ b/services/camera/libcameraservice/CameraHardwareInterface.h @@ -458,13 +458,17 @@ private: LOGV("%s", __FUNCTION__); CameraHardwareInterface *__this = static_cast<CameraHardwareInterface *>(user); - sp<CameraHeapMemory> mem(static_cast<CameraHeapMemory *>(data->handle)); - if (index >= mem->mNumBufs) { + if (data != NULL) { + sp<CameraHeapMemory> mem(static_cast<CameraHeapMemory *>(data->handle)); + if (index >= mem->mNumBufs) { LOGE("%s: invalid buffer index %d, max allowed is %d", __FUNCTION__, index, mem->mNumBufs); return; + } + __this->mDataCb(msg_type, mem->mBuffers[index], metadata, __this->mCbUser); + } else { + __this->mDataCb(msg_type, NULL, metadata, __this->mCbUser); } - __this->mDataCb(msg_type, mem->mBuffers[index], metadata, __this->mCbUser); } static void __data_cb_timestamp(nsecs_t timestamp, int32_t msg_type, |