Fix uninitialized variable warning
authorJiri Palecek <jpalecek@web.de>
Sat, 27 May 2023 19:31:01 +0000 (20:31 +0100)
committerAurélien COUDERC <coucouf@debian.org>
Sat, 27 May 2023 19:31:01 +0000 (20:31 +0100)
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

index 158f2c6e8ba7b6b9277f09616d18743d485d2f57..3d29089a04124979be5e7a0623c169d5bfcb6c17 100644 (file)
@@ -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;