Check for out of range gametype on map change

This commit is contained in:
James R 2019-11-19 12:25:50 -08:00
parent d1d1098f7c
commit 9b96964cbb
1 changed files with 3 additions and 1 deletions

View File

@ -2054,7 +2054,9 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
lastgametype = gametype;
gametype = READUINT8(*cp);
if (gametype != lastgametype)
if (gametype < 0 || gametype >= NUMGAMETYPES)
gametype = lastgametype;
else if (gametype != lastgametype)
D_GameTypeChanged(lastgametype); // emulate consvar_t behavior for gametype
skipprecutscene = ((flags & (1<<2)) != 0);