From 702af1a1d0974a70d5a603e1ed84acd281fa36e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Tue, 22 Apr 2025 12:27:06 +0200 Subject: apps: cam: capture_script: Disallow arrays of strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Paul Elder --- src/apps/cam/capture_script.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/apps/cam/capture_script.cpp b/src/apps/cam/capture_script.cpp index e7e69960..fdf82efc 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; -- cgit v1.2.1