From e0fcbea494a5882cb71ae2f1c9ac93f642e8694d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Fri, 25 Jul 2025 09:26:54 +0200 Subject: [PATCH] libcamera: control_serializer: Accept empty `ControlList` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Accept empty `ControlList`s without an info map. Serialization supports `ControlList`s without an associated `ControlInfoMap` object. However, for deserialization, a "v4l2" control list without an info map resulted in a fatal error. After 30114cadd8cb65 ("ipa: rpi: Defer initialising AF LensPosition ControlInfo and value") the `lensControls` member of `ipa::RPi::ConfigResult` is left empty and without an info map in every case, not just when a lens is not present. This causes the above assertion to trigger every single time. Also fix the indefinite article of "a ControlInfoMap" in the error message. Signed-off-by: Barnabás Pőcze Reviewed-by: Isaac Scott Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart --- src/libcamera/control_serializer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libcamera/control_serializer.cpp b/src/libcamera/control_serializer.cpp index 17834648..050f8512 100644 --- a/src/libcamera/control_serializer.cpp +++ b/src/libcamera/control_serializer.cpp @@ -601,8 +601,10 @@ ControlList ControlSerializer::deserialize(ByteStreamBuffer &buffer case IPA_CONTROL_ID_MAP_V4L2: default: - LOG(Serializer, Fatal) - << "A list of V4L2 controls requires an ControlInfoMap"; + if (hdr->entries > 0) + LOG(Serializer, Fatal) + << "A list of V4L2 controls requires a ControlInfoMap"; + return {}; } }