- Apply fix from EDuke32 commit 7225643e.

Fix undefined behavior/potential OOB access in ST_21_FLOOR_DOOR. g_AnimateGoal does not take a sector number, it takes an animation index, and caps at 1024, not 4096.
This commit is contained in:
Christoph Oelckers 2021-04-05 00:14:15 +02:00
parent 8e31c34b06
commit eb2e77fb75

View file

@ -753,7 +753,7 @@ static void handle_st21(int sn, DDukeActor* actor)
int j;
if (i >= 0)
{
if (animategoal[sn] == sptr->ceilingz)
if (animategoal[i] == sptr->ceilingz)
animategoal[i] = sector[nextsectorneighborz(sn, sptr->ceilingz, 1, 1)].floorz;
else animategoal[i] = sptr->ceilingz;
j = animategoal[i];