Commit 7225643e authored by Jordon Moss's avatar Jordon Moss

Fix undefined behavior/potential OOB access in ST_21_FLOOR_DOOR. g_AnimateGoal...

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.
parent 68a11485
......@@ -858,7 +858,7 @@ REDODOOR:
i = GetAnimationGoal(&pSector->floorz);
if (i >= 0)
{
if (g_animateGoal[sectNum] == pSector->ceilingz)
if (g_animateGoal[i] == pSector->ceilingz)
{
j = nextsectorneighborz(sectNum, pSector->ceilingz, 1, 1);
if (j == -1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment