engine.c: fix potential smostwall[-1] access. Found by ASan.

git-svn-id: https://svn.eduke32.com/eduke32@5807 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2016-07-04 14:09:05 +00:00
parent bcce4cd531
commit 46f39b725c

View file

@ -5867,8 +5867,9 @@ static void drawmaskwall(int16_t damaskwallcnt)
setup_globals_wall1(wal, wal->overpicnum);
setup_globals_wall2(wal, sec->visibility, z1, z2);
for (int i=smostwallcnt-1, j=smostwall[i]; i>=0; j=smostwall[--i])
for (int i=smostwallcnt-1; i>=0; i--)
{
int j=smostwall[i];
if ((xb1[j] > xb2[z]) || (xb2[j] < xb1[z])) continue;
if (wallfront(j,z)) continue;