From 4f1bb14732fc458808a673ed7eff2b0fb08d7943 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 16 Sep 2022 15:07:12 +0100 Subject: [PATCH] Extra catch to prevent SIGSEGV --- src/g_game.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/g_game.c b/src/g_game.c index c8fb69f46..b020179fa 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4599,6 +4599,12 @@ void G_InitNew(UINT8 pencoremode, INT32 map, boolean resetplayer, boolean skippr // internal game map // well this check is useless because it is done before (d_netcmd.c::command_map_f) // but in case of for demos.... + if (!mapname) + { + I_Error("Internal game map with ID %d not found\n", map); + Command_ExitGame_f(); + return; + } if (mapheaderinfo[map-1]->lumpnum == LUMPERROR) { I_Error("Internal game map '%s' not found\n", mapname);