summaryrefslogtreecommitdiff
path: root/src/sdl
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdl')
-rw-r--r--src/sdl/sdl_glimp.c5
1 files changed, 5 insertions, 0 deletions
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 )