summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-09-28 00:09:37 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-09-28 00:43:57 +0300
commit496e4467d298ef17fc1254f0e4e999ffc36a9b37 (patch)
tree8f57a0770008104ff2cc72c1539ba834e9aa96ca
parent2d5a78f664c5e0068cd3f78ff4c501cf4f331d3c (diff)
libcamera: control_serializer: Fix usage of uninitialized variable
The idMap variable may be used uninitialized in the ControlSerializer::deserialize<ControlList>() function as reported by gcc 11: ../../src/libcamera/control_serializer.cpp: In member function ‘T libcamera::ControlSerializer::deserialize(libcamera::ByteStreamBuffer&) [with T = libcamera::ControlList]’: ../../src/libcamera/control_serializer.cpp:609:33: error: ‘idMap’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 609 | ControlList ctrls(*idMap); | This is due to a missing default case in a switch/case. Fix it by adding the default case. Fixes: 6b1404fc4836 ("libcamera: control_serializer: Fix usage of uninitialized variable") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--src/libcamera/control_serializer.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libcamera/control_serializer.cpp b/src/libcamera/control_serializer.cpp
index 77b77448..e87d2362 100644
--- a/src/libcamera/control_serializer.cpp
+++ b/src/libcamera/control_serializer.cpp
@@ -594,6 +594,7 @@ ControlList ControlSerializer::deserialize<ControlList>(ByteStreamBuffer &buffer
break;
case IPA_CONTROL_ID_MAP_V4L2:
+ default:
LOG(Serializer, Fatal)
<< "A list of V4L2 controls requires an ControlInfoMap";
return {};