From 6a1b563be8d358a7d4af5b43307ace4c5f2c6a99 Mon Sep 17 00:00:00 2001 From: Pan7 Date: Sun, 26 Jul 2015 13:03:47 +0200 Subject: SDL_GetWindowDisplayIndex check --- src/sdl/sdl_glimp.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/sdl') diff --git a/src/sdl/sdl_glimp.c b/src/sdl/sdl_glimp.c index 9f86dd9e..e979ba1f 100644 --- a/src/sdl/sdl_glimp.c +++ b/src/sdl/sdl_glimp.c @@ -141,6 +141,11 @@ static void GLimp_DetectAvailableModes(void) SDL_DisplayMode windowMode; int display = SDL_GetWindowDisplayIndex( SDL_window ); + if( display < 0 ) + { + ri.Printf( PRINT_WARNING, "Couldn't get window display index, no resolutions detected\n" ); + return; + } numSDLModes = SDL_GetNumDisplayModes( display ); if( SDL_GetWindowDisplayMode( SDL_window, &windowMode ) < 0 || numSDLModes <= 0 ) -- cgit