From f2b6a6b2f6e9013a57efbda5cfea944558131aa4 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 20 Sep 2021 14:23:18 +0300 Subject: [PATCH] scenes/opengl: Fix null dereference in OpenGLWindow::windowTexture() If the SurfaceItem has no SurfacePixmap, kwin will crash when trying to access the surface texture. BUG: 437709 --- src/plugins/scenes/opengl/scene_opengl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/scenes/opengl/scene_opengl.cpp b/src/plugins/scenes/opengl/scene_opengl.cpp index db52c74ce7..aa899c68f2 100644 --- a/src/plugins/scenes/opengl/scene_opengl.cpp +++ b/src/plugins/scenes/opengl/scene_opengl.cpp @@ -1137,7 +1137,7 @@ QSharedPointer OpenGLWindow::windowTexture() PlatformOpenGLSurfaceTexture *frame = nullptr; const SurfaceItem *item = surfaceItem(); - if (item) { + if (item && item->pixmap()) { frame = static_cast(item->pixmap()->platformTexture()); }