summaryrefslogtreecommitdiff
path: root/debian/patches/qglxconvenience_nullptr.diff
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/qglxconvenience_nullptr.diff')
-rw-r--r--debian/patches/qglxconvenience_nullptr.diff25
1 files changed, 25 insertions, 0 deletions
diff --git a/debian/patches/qglxconvenience_nullptr.diff b/debian/patches/qglxconvenience_nullptr.diff
new file mode 100644
index 0000000..9e4588f
--- /dev/null
+++ b/debian/patches/qglxconvenience_nullptr.diff
@@ -0,0 +1,25 @@
+Description: qglxconvenience: avoid null pointer dereference
+Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=3c59065d5cb5f82f
+Last-Update: 2017-09-27
+
+--- a/src/platformsupport/glxconvenience/qglxconvenience.cpp
++++ b/src/platformsupport/glxconvenience/qglxconvenience.cpp
+@@ -164,7 +164,8 @@
+ template <class T>
+ struct QXlibScopedPointerDeleter {
+ static inline void cleanup(T *pointer) {
+- XFree(pointer);
++ if (pointer)
++ XFree(pointer);
+ }
+ };
+
+@@ -202,6 +203,8 @@
+ GLXFBConfig candidate = configs[i];
+
+ QXlibPointer<XVisualInfo> visual(glXGetVisualFromFBConfig(display, candidate));
++ if (visual.isNull())
++ continue;
+
+ const int actualRed = qPopulationCount(visual->red_mask);
+ const int actualGreen = qPopulationCount(visual->green_mask);