diff --git a/system/camerad/cameras/camera_common.cc b/system/camerad/cameras/camera_common.cc index b0193cf5dfcf67..569496fbfa7437 100644 --- a/system/camerad/cameras/camera_common.cc +++ b/system/camerad/cameras/camera_common.cc @@ -93,8 +93,10 @@ void CameraBuf::init(cl_device_id device_id, cl_context context, SpectraCamera * } CameraBuf::~CameraBuf() { - for (int i = 0; i < frame_buf_count; i++) { - camera_bufs_raw[i].free(); + if (camera_bufs_raw != nullptr) { + for (int i = 0; i < frame_buf_count; i++) { + camera_bufs_raw[i].free(); + } } if (imgproc) delete imgproc; }