From 4e8577f3cdf772bf302c2a4b256302e55e9df3a0 Mon Sep 17 00:00:00 2001 From: Jiri Palecek Date: Thu, 3 Aug 2023 17:55:01 +0100 Subject: [PATCH] Fix uninitialized variable warning Last-Update: 2020-06-04 If the YUV format isn't found, the code depends on .format being 0. However, it was not initialized at all, so this patch initializes the format member. The other members need not be initialized. Last-Update: 2020-06-04 Gbp-Pq: Name uninitialized-yuvformat.patch --- src/platformsupport/scenes/opengl/egl_dmabuf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platformsupport/scenes/opengl/egl_dmabuf.cpp b/src/platformsupport/scenes/opengl/egl_dmabuf.cpp index 158f2c6..3d29089 100644 --- a/src/platformsupport/scenes/opengl/egl_dmabuf.cpp +++ b/src/platformsupport/scenes/opengl/egl_dmabuf.cpp @@ -152,7 +152,7 @@ KWaylandServer::LinuxDmaBufV1ClientBuffer *EglDmabuf::importBuffer(DmaBufAttribu KWaylandServer::LinuxDmaBufV1ClientBuffer *EglDmabuf::yuvImport(DmaBufAttributes &&attrs, quint32 flags) { - YuvFormat yuvFormat; + YuvFormat yuvFormat { 0 }; for (YuvFormat f : yuvFormats) { if (f.format == attrs.format) { yuvFormat = f; -- 2.30.2