- fixed OOB access in pushmove.

The backwards search loop starts at one element behind the data it is supposed to check. If this is the last wall in the map it accesses undefined memory.

This tripped the range check in TArray for wall[].
This commit is contained in:
Christoph Oelckers 2021-12-12 15:52:40 +01:00
parent 4562a0ca97
commit a23d2ae656

View file

@ -868,7 +868,7 @@ int pushmove_(vec3_t *const vect, int *const sectnum,
if (dir > 0)
startwall = sec->wallptr, endwall = startwall + sec->wallnum;
else
endwall = sec->wallptr, startwall = endwall + sec->wallnum;
endwall = sec->wallptr - 1, startwall = endwall + sec->wallnum - 1;
int i;