7090a9367d
1 OBS-URL: https://build.opensuse.org/request/show/525883 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtbase?expand=0&rev=66
34 lines
1.4 KiB
Diff
34 lines
1.4 KiB
Diff
From 37b279dda0387ad917da586c19c0605c0be10afc Mon Sep 17 00:00:00 2001
|
|
From: Kai Uwe Broulik <kde@privat.broulik.de>
|
|
Date: Tue, 12 Sep 2017 16:18:58 +0200
|
|
Subject: [PATCH] qglxconvenience: Avoid null pointer dereference
|
|
References: boo#1057971, kde#384540
|
|
|
|
glXGetVisualFromFBConfig according to documentation can return NULL [1].
|
|
This may result in a crash when running Qt applications using ARGB windows
|
|
with XLIB_SKIP_ARGB_VISUALS defined.
|
|
|
|
[1] https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glXGetVisualFromFBConfig.xml
|
|
|
|
Change-Id: Ie076a1e906ed632543bdab03ef365f699533a61a
|
|
---
|
|
src/platformsupport/glxconvenience/qglxconvenience.cpp | 2 ++
|
|
1 file changed, 2 insertions(+)
|
|
|
|
diff --git a/src/platformsupport/glxconvenience/qglxconvenience.cpp b/src/platformsupport/glxconvenience/qglxconvenience.cpp
|
|
index 8c26550..46bd579 100644
|
|
--- a/src/platformsupport/glxconvenience/qglxconvenience.cpp
|
|
+++ b/src/platformsupport/glxconvenience/qglxconvenience.cpp
|
|
@@ -202,6 +202,8 @@ GLXFBConfig qglx_findConfig(Display *display, int screen , QSurfaceFormat format
|
|
GLXFBConfig candidate = configs[i];
|
|
|
|
QXlibPointer<XVisualInfo> visual(glXGetVisualFromFBConfig(display, candidate));
|
|
+ if (!visual)
|
|
+ continue;
|
|
|
|
const int actualRed = qPopulationCount(visual->red_mask);
|
|
const int actualGreen = qPopulationCount(visual->green_mask);
|
|
--
|
|
2.7.4
|
|
|