[iortcw] 69/497: All: Don't crash when fail to create SDL window

Simon McVittie smcv at debian.org
Fri Sep 8 10:36:23 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit 35bb7d2ae844b852acb2a04cd90b6cf8df1c97f0
Author: M4N4T4RMS at gmail.com <M4N4T4RMS at gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a>
Date:   Sat Mar 15 23:06:10 2014 +0000

    All: Don't crash when fail to create SDL window
---
 MP/code/sdl/sdl_glimp.c | 6 ++++++
 SP/code/sdl/sdl_glimp.c | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/MP/code/sdl/sdl_glimp.c b/MP/code/sdl/sdl_glimp.c
index da90a02..f1aea87 100644
--- a/MP/code/sdl/sdl_glimp.c
+++ b/MP/code/sdl/sdl_glimp.c
@@ -492,6 +492,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);
diff --git a/SP/code/sdl/sdl_glimp.c b/SP/code/sdl/sdl_glimp.c
index da90a02..f1aea87 100644
--- a/SP/code/sdl/sdl_glimp.c
+++ b/SP/code/sdl/sdl_glimp.c
@@ -492,6 +492,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);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list