summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorUmang Jain <umang.jain@ideasonboard.com>2021-10-07 15:09:36 +0530
committerUmang Jain <umang.jain@ideasonboard.com>2021-11-08 16:50:27 +0530
commit701266653c7a4b5cb0213e6a6003f0aea0401f6b (patch)
tree2b94c209b0812162f98747ee665eb0cd206b89a9 /src
parenta5b323e05dae6d9579b230514485cb04c6a764da (diff)
android: mm: Null check for CameraBufferManager
cros::CameraBufferManager can be nullptr if there is an error in its creation. Place a null-check guard to check it. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/android/mm/cros_camera_buffer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/android/mm/cros_camera_buffer.cpp b/src/android/mm/cros_camera_buffer.cpp
index 86770135..2ac3dc4a 100644
--- a/src/android/mm/cros_camera_buffer.cpp
+++ b/src/android/mm/cros_camera_buffer.cpp
@@ -60,6 +60,11 @@ CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer,
registered_(false)
{
bufferManager_ = cros::CameraBufferManager::GetInstance();
+ if (!bufferManager_) {
+ LOG(HAL, Fatal)
+ << "Failed to get cros CameraBufferManager instance";
+ return;
+ }
int ret = bufferManager_->Register(camera3Buffer);
if (ret) {