From c211268b350825f8e8f08e7c17df7601daa8a7cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 20 Jun 2016 17:01:15 +0200 Subject: [PATCH] Verify that windowPixmap<>() does not return a nullptr before accessing the children windowPixmap() is allowed to return a nullptr, thus we need to verify that the returned pointer is not null. If it is null it's the same as if there are no child WindowPixmaps. --- scene_opengl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 38fc53ed15..239a585cc5 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -1646,7 +1646,8 @@ void SceneOpenGL2Window::performPaint(int mask, QRegion region, WindowPaintData setBlendEnabled(false); // render sub-surfaces - const auto &children = windowPixmap()->children(); + auto wp = windowPixmap(); + const auto &children = wp ? wp->children() : QVector(); windowMatrix.translate(toplevel->clientPos().x(), toplevel->clientPos().y()); for (auto pixmap : children) { if (pixmap->subSurface().isNull() || pixmap->subSurface()->surface().isNull() || !pixmap->subSurface()->surface()->isMapped()) {