From d33c6b5409b908a56af689a208d943360fca3c27 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 28 Sep 2023 15:47:45 +0200 Subject: [PATCH] backends/drm: don't crash if the surface is nullptr CCBUG: 474987 --- src/backends/drm/drm_egl_layer_surface.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backends/drm/drm_egl_layer_surface.cpp b/src/backends/drm/drm_egl_layer_surface.cpp index e8d32cca2b..0bbd938f42 100644 --- a/src/backends/drm/drm_egl_layer_surface.cpp +++ b/src/backends/drm/drm_egl_layer_surface.cpp @@ -168,6 +168,9 @@ bool EglGbmLayerSurface::endRendering(const QRegion &damagedRegion) std::chrono::nanoseconds EglGbmLayerSurface::queryRenderTime() const { + if (!m_surface) { + return std::chrono::nanoseconds::zero(); + } const auto cpuTime = m_surface->renderEnd - m_surface->renderStart; if (m_surface->timeQuery) { m_eglBackend->makeCurrent();