From 8455b5a833442d5836d2329c605534a4fca284f9 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sat, 15 Mar 2014 17:53:42 -0500 Subject: [PATCH] Don't crash when fail to create SDL window --- code/sdl/sdl_glimp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/sdl/sdl_glimp.c b/code/sdl/sdl_glimp.c index cd9581bf..0785ad0c 100644 --- a/code/sdl/sdl_glimp.c +++ b/code/sdl/sdl_glimp.c @@ -462,6 +462,12 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder) SDL_FreeSurface( icon ); + if( !SDL_window ) + { + ri.Printf( PRINT_ALL, "Couldn't get a visual\n" ); + return RSERR_INVALID_MODE; + } + GLimp_DetectAvailableModes(); glstring = (char *) qglGetString (GL_RENDERER);