Commit 3e3570dff73a7d465a27f4c433621c84e4bb4e43

Sam Lantinga 2014-04-23T13:47:57

Don't crash in WIN_GL_InitExtensions() if the OpenGL library couldn't be loaded

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/video/windows/SDL_windowsopengl.c b/src/video/windows/SDL_windowsopengl.c
index 80ba3b4..71855c8 100644
--- a/src/video/windows/SDL_windowsopengl.c
+++ b/src/video/windows/SDL_windowsopengl.c
@@ -334,6 +334,10 @@ WIN_GL_InitExtensions(_THIS)
     HGLRC hglrc;
     PIXELFORMATDESCRIPTOR pfd;
 
+    if (!_this->gl_data) {
+        return;
+    }
+
     hwnd =
         CreateWindow(SDL_Appname, SDL_Appname, (WS_POPUP | WS_DISABLED), 0, 0,
         10, 10, NULL, NULL, SDL_Instance, NULL);