[libcamera-devel] [PATCH] qcam: viewfinder_gl: selectColorSpace: fix maybe uninitialized warning

Marco Felsch m.felsch at pengutronix.de
Fri Sep 2 16:11:36 CEST 2022


Fix gcc11 warning introduced in commit 251f0534 ("qcam: viewfinder_gl:
Take color space into account for YUV rendering"). Fix it by making the
full range as default.

Fixes: 251f0534 ("qcam: viewfinder_gl: Take color space into account for YUV rendering")
Signed-off-by: Marco Felsch <m.felsch at pengutronix.de>
---
 src/qcam/viewfinder_gl.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/qcam/viewfinder_gl.cpp b/src/qcam/viewfinder_gl.cpp
index e2aa2470..501c5bae 100644
--- a/src/qcam/viewfinder_gl.cpp
+++ b/src/qcam/viewfinder_gl.cpp
@@ -367,6 +367,7 @@ void ViewFinderGL::selectColorSpace(const libcamera::ColorSpace &colorSpace)
 	double offset;
 
 	switch (colorSpace.range) {
+	default: /* Avoid gcc11 maybe-uninitialized warning */
 	case libcamera::ColorSpace::Range::Full:
 		offset = 0.0;
 		break;
-- 
2.30.2



More information about the libcamera-devel mailing list