From 6cf060223ee63745be78fe0aec4f0d90c6579a31 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 28 Sep 2021 17:57:52 +0200 Subject: [PATCH] gbm: Do not create buffers when there is no display --- src/plugins/platforms/drm/gbm_dmabuf.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/platforms/drm/gbm_dmabuf.cpp b/src/plugins/platforms/drm/gbm_dmabuf.cpp index fab7bda185..2bc53a6a00 100644 --- a/src/plugins/platforms/drm/gbm_dmabuf.cpp +++ b/src/plugins/platforms/drm/gbm_dmabuf.cpp @@ -58,6 +58,9 @@ KWin::GbmDmaBuf *GbmDmaBuf::createBuffer(const QSize &size, gbm_device *device) }; EGLDisplay display = kwinApp()->platform()->sceneEglDisplay(); + if (display == EGL_NO_DISPLAY) { + return nullptr; + } EGLImageKHR destinationImage = eglCreateImageKHR(display, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, nullptr, importAttributes); if (destinationImage == EGL_NO_IMAGE_KHR) { close(fd);