From 01b14e14e63ac85d295755880bcf7d441c4ff0ce Mon Sep 17 00:00:00 2001 From: pionere Date: Tue, 12 Apr 2022 08:49:19 +0200 Subject: [PATCH] avoid NullPointer in SDL_GL_MakeCurrent --- src/video/SDL_video.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 6537b4535ffb6..2b09524302164 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -3924,6 +3924,10 @@ SDL_GL_MakeCurrent(SDL_Window * window, SDL_GLContext ctx) { int retval; + if (!_this) { + return SDL_UninitializedVideo(); + } + if (window == SDL_GL_GetCurrentWindow() && ctx == SDL_GL_GetCurrentContext()) { /* We're already current. */