From b3272f78278ab18cf9467e06d676eb7f1e27b669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Wed, 5 Feb 2025 17:05:38 +0100 Subject: libcamera: controls: Check size of enum MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only enums whose sizes match that of `int32_t` can be directly supported. Otherwise the expected size and the real size would disagree, leading to an assertion failure in `ControlValue::set()`. Signed-off-by: Barnabás Pőcze Reviewed-by: Jacopo Mondi Reviewed-by: Kieran Bingham --- include/libcamera/controls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index 7c7828ae..4bfe9615 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -125,7 +125,7 @@ struct control_type> : public control_type> { }; template -struct control_type>> : public control_type { +struct control_type && sizeof(T) == sizeof(int32_t)>> : public control_type { }; } /* namespace details */ -- cgit v1.2.1