From 13bc5da2a2cbdefcbc862f16b3799387c5b50eea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dirk=20M=C3=BCller?= <[EMAIL REDACTED]>
Date: Mon, 5 Oct 2026 09:01:57 +0200
Subject: [PATCH] kmsdrm: Avoid continuing if just the makecurrent failed
According to the source code comment we have another invocation later
on. Without this, the next loop iteration either overwrites windata->gs,
causing a leak, or aborts and triggers the assert `SDL_assert(result || (windata->gs == NULL))`
---
src/video/kmsdrm/SDL_kmsdrmvideo.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c
index 2dd451f9962f7..6099076331a7e 100644
--- a/src/video/kmsdrm/SDL_kmsdrmvideo.c
+++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c
@@ -1863,7 +1863,6 @@ bool KMSDRM_CreateSurfaces(SDL_VideoDevice *_this, SDL_Window *window)
result = SDL_EGL_MakeCurrent(_this, windata->egl_surface, egl_context);
if (!result) {
SDL_LogWarn(SDL_LOG_CATEGORY_VIDEO, "KMSDRM: SDL_EGL_MakeCurrent with GBM_FORMAT_%s failed: %s", gbm_formats[i].name, SDL_GetError());
- continue;
}
_this->gl_config.red_size = gbm_formats[i].r;