From patchwork Thu May 1 09:58:16 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: 23325 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 36054BE08B for ; Thu, 1 May 2025 09:58:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7936168ADE; Thu, 1 May 2025 11:58:25 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="dFUP0UQ9"; 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 9C07568ADA for ; Thu, 1 May 2025 11:58:22 +0200 (CEST) Received: from pb-laptop.local (185.221.143.50.nat.pool.zt.hu [185.221.143.50]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 85D1E63D; Thu, 1 May 2025 11:58:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1746093495; bh=M/F0lfXmZgua+g7k0p2HH++QB+xdVP8F1I1Qu9UbYsM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dFUP0UQ95MX1TnN9iBazoNGdbc3Wn8oSnOFxgSa64DTNWIAvq5t9qn88juzRQyxNJ tKdPWAcajE7+9qUM9qeUBM642cnWXqMXiFFQ7HFWStvmH5Z/ZdLBVcx8cfs3Isxdaz LWCHC48b5uXSBGUV7i7leHAo69WvZeKh6OvhJXXQ= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Kieran Bingham Subject: [PATCH v2 1/3] apps: cam: capture_script: Disallow arrays of strings Date: Thu, 1 May 2025 11:58:16 +0200 Message-ID: <20250501095818.3996419-2-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250501095818.3996419-1-barnabas.pocze@ideasonboard.com> References: <20250501095818.3996419-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 Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- 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;