Browse Source

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

Sam Lantinga 11 years ago
parent
commit
3e3570dff7
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/video/windows/SDL_windowsopengl.c

+ 4 - 0
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);