From patchwork Tue Apr 22 12:47:50 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: 23205 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 99772BE08B for ; Tue, 22 Apr 2025 12:48:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7DCB468AD0; Tue, 22 Apr 2025 14:47:59 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="vMEsurTH"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2F64E617E6 for ; Tue, 22 Apr 2025 14:47:56 +0200 (CEST) Received: from pb-laptop.local (185.221.143.16.nat.pool.zt.hu [185.221.143.16]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9C529666 for ; Tue, 22 Apr 2025 14:45:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1745325948; bh=q0h9SLaAylBdoyOGnrcJVJvmydinzayn/dBVekx7lwo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vMEsurTHVU2Ba4old+Z69tK8DfPbBnCYtWmWfUYq4Yqs95Qj2jQwMRBgAUvHYTSsp SgS+6HLl0/5EMWtnjhTRRdFGEL8/IslyFbsHHTgAomJ+2ZeLmDIG7k2AHFrq4sWo5T gQHX9Ud7/iPnqNVcR1XFSiUOPYx7uhO1kKmTXScA= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1 1/2] apps: cam: capture_script: Disallow arrays of strings Date: Tue, 22 Apr 2025 14:47:50 +0200 Message-ID: <20250422124751.30409-2-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250422124751.30409-1-barnabas.pocze@ideasonboard.com> References: <20250422124751.30409-1-barnabas.pocze@ideasonboard.com> 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" The current `ControlValue` mechanism does not support arrays of strings, the assignment in the removed snippet will in fact trigger an assertion failure in `ControlValue::set()` because `sizeof(std::string) != ControlValueSize[ControlTypeString]`. Fixes: b35f04b3c194 ("cam: capture_script: Support parsing array controls") Signed-off-by: Barnabás Pőcze --- src/apps/cam/capture_script.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/apps/cam/capture_script.cpp b/src/apps/cam/capture_script.cpp index e7e69960e..fdf82efc0 100644 --- a/src/apps/cam/capture_script.cpp +++ b/src/apps/cam/capture_script.cpp @@ -578,10 +578,6 @@ ControlValue CaptureScript::parseArrayControl(const ControlId *id, value = Span(values.data(), values.size()); break; } - case ControlTypeString: { - value = Span(repr.data(), repr.size()); - break; - } default: std::cerr << "Unsupported control type" << std::endl; break;