Commit 01b14e14e63ac85d295755880bcf7d441c4ff0ce

pionere 2022-04-12T08:49:19

avoid NullPointer in SDL_GL_MakeCurrent

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index 6537b45..2b09524 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. */