Don't crash if loading the OpenGL library fails
authorSam Lantinga <slouken@libsdl.org>
Fri, 28 Dec 2012 14:46:03 -0800
changeset 6775 ca20a61fe03b
parent 6774 ad8522052ce6
child 6776 2a66a4c817bf
Don't crash if loading the OpenGL library fails
src/video/SDL_video.c
--- a/src/video/SDL_video.c	Fri Dec 28 03:46:55 2012 -0500
+++ b/src/video/SDL_video.c	Fri Dec 28 14:46:03 2012 -0800
@@ -1305,7 +1305,9 @@
 
     if ((window->flags & SDL_WINDOW_OPENGL) != (flags & SDL_WINDOW_OPENGL)) {
         if (flags & SDL_WINDOW_OPENGL) {
-            SDL_GL_LoadLibrary(NULL);
+            if (SDL_GL_LoadLibrary(NULL) < 0) {
+                return -1;
+            }
         } else {
             SDL_GL_UnloadLibrary();
         }