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
This commit is contained in:
terminx 2018-10-07 05:21:58 +00:00
parent 870f1c4dab
commit 4f590f59c1

View file

@ -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;