[libcamera-devel] [PATCH 1/2] android: mm: Null check for CameraBufferManager
Umang Jain
umang.jain at ideasonboard.com
Thu Oct 7 11:39:36 CEST 2021
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 at ideasonboard.com>
---
src/android/mm/cros_camera_buffer.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/android/mm/cros_camera_buffer.cpp b/src/android/mm/cros_camera_buffer.cpp
index 86770135..97a04c68 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, Error)
+ << "Failed to get cros CameraBufferManager instance";
+ return;
+ }
int ret = bufferManager_->Register(camera3Buffer);
if (ret) {
--
2.31.1
More information about the libcamera-devel
mailing list