From 4f590f59c131f971207cb5929159b86afcbf0b33 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 7 Oct 2018 05:21:58 +0000 Subject: [PATCH] Fix potential OOB spriteext[] access when checking SPREXT_NOTMD to determine whether or not to render a sprite's model, if available git-svn-id: https://svn.eduke32.com/eduke32@7023 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/engine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 17ba2f9ff..2aecddeee 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -4804,7 +4804,7 @@ static void classicDrawSprite(int32_t snum) if ((cstat&48)==48) vtilenum = tilenum; // if the game wants voxels, it gets voxels - else if (usevoxels && tiletovox[tilenum] != -1 && !(spriteext[spritenum].flags&SPREXT_NOTMD)) + else if (usevoxels && tiletovox[tilenum] != -1 && spritenum != -1 && !(spriteext[spritenum].flags&SPREXT_NOTMD)) { vtilenum = tiletovox[tilenum]; cstat |= 48;