From 0f1da589ebc90d7436d4f6e8a418be76c10258c6 Mon Sep 17 00:00:00 2001 From: Aki Sakurai Date: Thu, 28 Sep 2023 23:50:32 +0800 Subject: [PATCH] fix segfault in EglGbmBackend::textureForOutput --- src/backends/drm/drm_egl_backend.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backends/drm/drm_egl_backend.cpp b/src/backends/drm/drm_egl_backend.cpp index 7bcf36e217..6e7f700d54 100644 --- a/src/backends/drm/drm_egl_backend.cpp +++ b/src/backends/drm/drm_egl_backend.cpp @@ -167,6 +167,9 @@ OutputLayer *EglGbmBackend::cursorLayer(Output *output) std::pair, ColorDescription> EglGbmBackend::textureForOutput(Output *output) const { const auto drmOutput = static_cast(output); + if (const auto virtualLayer = dynamic_cast(drmOutput->primaryLayer())) { + return std::make_pair(virtualLayer->texture(), ColorDescription::sRGB); + } const auto layer = static_cast(drmOutput->primaryLayer()); return std::make_pair(layer->texture(), layer->colorDescription()); }