From 8f8f033956eeef824f082470533a4942e489895e Mon Sep 17 00:00:00 2001 From: sirlemonhead Date: Fri, 13 Mar 2020 11:46:00 +0000 Subject: [PATCH] Rednukem: Limit sprite shade change to Redneck Rampage games, and add guard for invalid array access. Fixes ASAN error. --- source/rr/src/game.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/rr/src/game.cpp b/source/rr/src/game.cpp index 19de48bcf..dca1e42e1 100644 --- a/source/rr/src/game.cpp +++ b/source/rr/src/game.cpp @@ -3181,7 +3181,8 @@ rr_badguy: } else changespritestat(newSprite, STAT_ZOMBIEACTOR); - pSprite->shade = sprite[spriteNum].shade; + if (RR && spriteNum >= 0) + pSprite->shade = sprite[spriteNum].shade; } break;