File: 0086-fix-variable-not-initialized.patch

package info (click to toggle)
qtwayland-opensource-src 5.15.17-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 11,108 kB
  • sloc: cpp: 53,691; xml: 9,462; ansic: 187; makefile: 29; sh: 5
file content (27 lines) | stat: -rw-r--r-- 1,182 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From ec4fa1a0bf2981b7ef6d7caec84f3b1ac706d14b Mon Sep 17 00:00:00 2001
From: Liu Zheng <liuzheng@uniontech.com>
Date: Wed, 24 Jul 2024 09:22:42 +0800
Subject: [PATCH] fix: variable not initialized

If the disableResizeCheck logic is not checked, initialization will fail. Problems will arise later.

Pick-to: 6.8 6.7 6.5 6.2 5.15
Change-Id: Ifffd4f7407b3ef616d436b81f3b2148c1139c3f7
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit dc49720c135e0d59dff42c9fd28f57a6199c33b9)
---
 .../client/wayland-egl/qwaylandeglwindow.cpp                   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
@@ -118,7 +118,8 @@ void QWaylandEglWindow::updateSurface(bool create)
     } else {
         QReadLocker locker(&mSurfaceLock);
         if (m_waylandEglWindow) {
-            int current_width, current_height;
+            int current_width = 0;
+            int current_height = 0;
             static bool disableResizeCheck = qgetenv("QT_WAYLAND_DISABLE_RESIZECHECK").toInt();
 
             if (!disableResizeCheck) {