[libcamera-devel] [PATCH v2 0/2] libcamera: controls: guard ControlInfoMap against nullptr idmap_

Mattijs Korpershoek mkorpershoek at baylibre.com
Wed Apr 5 10:14:29 CEST 2023


I have:
* build-tested and unit-tested this (using vimc) on master
* functionally tested on a v0.0.4 android integration branch.

I've tested that i'm able to do a camera preview even when the
ScalerCrop control is unavailable.
The crash reported in http://codepad.org/CiLLcPNW is no longer
reproduced.

Note that Jacopo already discussed alternative implementation by making
idmap_ an instance instead of a pointer, but that seemed not a good idea
either:

https://lists.libcamera.org/pipermail/libcamera-devel/2023-April/037439.html

Signed-off-by: Mattijs Korpershoek <mkorpershoek at baylibre.com>
---
Changes in v2:
- Became a series: added ControlInfoMap unit test to catch the segfault
- Dropped codepad link from commit message
- Link to v1: https://lists.libcamera.org/pipermail/libcamera-devel/2023-April/037443.html

---
Mattijs Korpershoek (2):
      libcamera: controls: guard ControlInfoMap against nullptr idmap_
      test: controls: control_info_map: Test default constructor

 src/libcamera/controls.cpp         | 16 ++++++++++++++++
 test/controls/control_info_map.cpp |  7 +++++++
 2 files changed, 23 insertions(+)
---
base-commit: ac7511dc4c594f567ddff27ccc02c30bf6c00bfd
change-id: 20230404-guard-idmap-1d95f2100aca

Best regards,
-- 
Mattijs Korpershoek <mkorpershoek at baylibre.com>



More information about the libcamera-devel mailing list