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
This commit is contained in:
Vlad Zahorodnii 2021-09-20 14:23:18 +03:00
parent e004f1b7fc
commit f2b6a6b2f6

View file

@ -1137,7 +1137,7 @@ QSharedPointer<GLTexture> OpenGLWindow::windowTexture()
PlatformOpenGLSurfaceTexture *frame = nullptr;
const SurfaceItem *item = surfaceItem();
if (item) {
if (item && item->pixmap()) {
frame = static_cast<PlatformOpenGLSurfaceTexture *>(item->pixmap()->platformTexture());
}