fix segfault in EglGbmBackend::textureForOutput

This commit is contained in:
Aki Sakurai 2023-09-28 23:50:32 +08:00
parent d33c6b5409
commit 0f1da589eb

View file

@ -167,6 +167,9 @@ OutputLayer *EglGbmBackend::cursorLayer(Output *output)
std::pair<std::shared_ptr<KWin::GLTexture>, ColorDescription> EglGbmBackend::textureForOutput(Output *output) const
{
const auto drmOutput = static_cast<DrmAbstractOutput *>(output);
if (const auto virtualLayer = dynamic_cast<VirtualEglGbmLayer *>(drmOutput->primaryLayer())) {
return std::make_pair(virtualLayer->texture(), ColorDescription::sRGB);
}
const auto layer = static_cast<EglGbmLayer *>(drmOutput->primaryLayer());
return std::make_pair(layer->texture(), layer->colorDescription());
}