From 805de60aa422e722af05d2b2fe41fca7e4d25985 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 30 Jul 2013 09:16:27 +0200 Subject: [PATCH] - fixed: ChangeSpy didn't check if a player's camera's player pointer was valid before using it to get an index into the players table. --- src/g_game.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/g_game.cpp b/src/g_game.cpp index 0db149b0b..506b8e24b 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -862,7 +862,10 @@ static void ChangeSpy (int changespy) int pnum = consoleplayer; if (changespy != SPY_CANCEL) { - pnum = int(players[consoleplayer].camera->player - players); + player_t *player = players[consoleplayer].camera->player; + // only use the camera as starting index if it's a valid player. + if (player != NULL) pnum = int(players[consoleplayer].camera->player - players); + int step = (changespy == SPY_NEXT) ? 1 : -1; do