From b1254d534008cc4669de255fbb16d0ef17df68ca Mon Sep 17 00:00:00 2001 From: msxmine Date: Fri, 27 Jan 2023 12:49:38 +0100 Subject: [PATCH] Check for nullptr connector in drm_prepare Fixes gamescope sometimes segfaulting for me. --- src/drm.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/drm.cpp b/src/drm.cpp index f1c753b..40ec0c5 100644 --- a/src/drm.cpp +++ b/src/drm.cpp @@ -1751,6 +1751,10 @@ drm_prepare_liftoff( struct drm_t *drm, const struct FrameInfo_t *frameInfo, boo * negative errno on failure or if the scene-graph can't be presented directly. */ int drm_prepare( struct drm_t *drm, bool async, const struct FrameInfo_t *frameInfo ) { + if (!(drm->connector)){ + return -EACCES; + } + drm->pending.screen_type = drm_get_screen_type(drm); drm_update_gamma_lut(drm);