File workaround-null-object.patch of Package libqt5-qtwayland
From: Fabian Vogt <fabian@ritter-vogt.de>
Subject: Work around crash in QtWaylandClient::QWaylandEglWindow::updateSurface
References: kde#381630
object() is nullptr when it crashes, so do not try to reference it.
This is only a workaround as object() should never be nullptr AFAICT.
So far I haven't discovered any bad side effects.
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
index 24dadff..aed8c57 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
@@ -113,7 +113,7 @@ void QWaylandEglWindow::updateSurface(bool create)
// mesa's egl returns NULL if we try to create a, invalid wl_egl_window, however not all EGL
// implementations may do that, so check the size ourself. Besides, we must deal with resizing
// a valid window to 0x0, which would make it invalid. Hence, destroy it.
- if (sizeWithMargins.isEmpty()) {
+ if (sizeWithMargins.isEmpty() || !object()) {
if (m_eglSurface) {
eglDestroySurface(m_clientBufferIntegration->eglDisplay(), m_eglSurface);
m_eglSurface = 0;