Fix uninitialized variable warning
authorJiri Palecek <jpalecek@web.de>
Wed, 6 Jan 2021 14:50:52 +0000 (14:50 +0000)
committerNorbert Preining <norbert@preining.info>
Wed, 6 Jan 2021 14:50:52 +0000 (14:50 +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

platformsupport/scenes/opengl/egl_dmabuf.cpp

index 45d325161d056d123546f034d2be4432581623e8..55a82700310f44c6f6cb3799aaf8ee31cf21e04a 100644 (file)
@@ -271,7 +271,7 @@ KWaylandServer::LinuxDmabufUnstableV1Buffer* EglDmabuf::yuvImport(const QVector<
                                                                     const QSize &size,
                                                                     Flags flags)
 {
-    YuvFormat yuvFormat;
+    YuvFormat yuvFormat { 0 };
     for (YuvFormat f : yuvFormats) {
         if (f.format == format) {
             yuvFormat = f;