From patchwork Mon Jul 21 11:50:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 23891 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 22267BDCC1 for ; Mon, 21 Jul 2025 11:50:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 18D0A68FE1; Mon, 21 Jul 2025 13:50:34 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="K/fhuC2+"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5E20768FD0 for ; Mon, 21 Jul 2025 13:50:33 +0200 (CEST) Received: from pb-laptop.local (185.221.140.39.nat.pool.zt.hu [185.221.140.39]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 66B9CEAE for ; Mon, 21 Jul 2025 13:49:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1753098596; bh=ovoTjcoqRgCLIo/ilCgyuB3XhhdAIEEC+K08AydkPds=; h=From:To:Subject:Date:From; b=K/fhuC2+zq6sjDXFFAvUVdUGeuBJUzejowbr2OxmY7U2e6FJ2E6L7aw5bPUdY9mL6 5S4GrJLiKzqSnkOD23FvOCgBpslPLeEqSCdhf3yQiyVkv98qH8q7VbDsXgUsGr5z5u wlVu6E8twfCaSu9JG+ia9mG5cFI2hAZd/hwMi8yU= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1] libcamera: control_serializer: Accept empty `ControlList` Date: Mon, 21 Jul 2025 13:50:29 +0200 Message-ID: <20250721115029.1561179-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.50.1 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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. Signed-off-by: Barnabás Pőcze Reviewed-by: Isaac Scott Reviewed-by: Kieran Bingham --- src/libcamera/control_serializer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libcamera/control_serializer.cpp b/src/libcamera/control_serializer.cpp index 17834648c..1534fc5c8 100644 --- a/src/libcamera/control_serializer.cpp +++ b/src/libcamera/control_serializer.cpp @@ -601,8 +601,11 @@ 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 an ControlInfoMap"; + } + return {}; } }