From 1203b0aa73dad58cf411a4349504a3701290c680 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 7 Jan 2016 23:48:19 -0800 Subject: [PATCH] Fix crash on game clear (No, game, you can't allocate a map header for the credits, why were you doing that before and how did it not break anything??) (cherry picked from commit e1f9a012297d5220dcdd9395265467621a170e32) --- src/g_game.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index 08853643..7941c33d 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2874,7 +2874,8 @@ static void G_DoCompleted(void) // We are committed to this map now. // We may as well allocate its header if it doesn't exist - if(!mapheaderinfo[nextmap]) + // (That is, if it's a real map) + if (nextmap < NUMMAPS && !mapheaderinfo[nextmap]) P_AllocMapHeader(nextmap); if (skipstats)