From 26c7ade6ac9ee027b66481086e2b88f9cddf9302 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Fri, 3 Apr 2015 08:57:24 +0000
Subject: [PATCH] When calling setup_surfaces() from a SDL_USEREVENT_SETVIDMODE
 event, set new_scaling and old_scaling to prevent setup_surfaces() from being
 called again while the window is initially being set up in a mode other than
 the default 80x25.

Fixes a Windows crash when starting in other modes.
---
 src/conio/sdl_con.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/conio/sdl_con.c b/src/conio/sdl_con.c
index adebac52c7..254f817c0d 100644
--- a/src/conio/sdl_con.c
+++ b/src/conio/sdl_con.c
@@ -1726,6 +1726,8 @@ int sdl_video_event_thread(void *data)
 										sdl.PeepEvents(&ev, 1, SDL_ADDEVENT, 0xffffffff);
 									}
 								}
+								new_scaling = -1;
+								old_scaling = vstat.scaling;
 								setup_surfaces();
 								sdl_ufunc_retval=0;
 								sdl.SemPost(sdl_ufunc_ret);
-- 
GitLab