From fec4e058e59f5245db9f906dc78000194ba850b7 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 15 Sep 2020 13:53:17 +0200 Subject: [PATCH] Do not try to create a gbm dmabuf when gbm is not available Allows us to take the fallback path instead of just crashing --- plugins/platforms/drm/gbm_dmabuf.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/platforms/drm/gbm_dmabuf.cpp b/plugins/platforms/drm/gbm_dmabuf.cpp index b2015b96fa..866ac7a13a 100644 --- a/plugins/platforms/drm/gbm_dmabuf.cpp +++ b/plugins/platforms/drm/gbm_dmabuf.cpp @@ -31,6 +31,10 @@ GbmDmaBuf::~GbmDmaBuf() KWin::GbmDmaBuf *GbmDmaBuf::createBuffer(const QSize &size, gbm_device *device) { + if (!device) { + return nullptr; + } + auto bo = gbm_bo_create(device, size.width(), size.height(), GBM_BO_FORMAT_ARGB8888, GBM_BO_USE_RENDERING | GBM_BO_USE_LINEAR); if (!bo) {