Fix uninitialized variable warning
authorJiri Palecek <jpalecek@web.de>
Fri, 6 Jan 2023 23:22:19 +0000 (23:22 +0000)
committerAurélien COUDERC <coucouf@debian.org>
Fri, 6 Jan 2023 23:22:19 +0000 (23:22 +0000)
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 141235ddf37279f049dba42849b31df15704fbe6..7c449be364a470e6d8efda7ed20a9f57e6778943 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;