Commit defbbfb6 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

engine: fix use of value before validation in polymer_updatewall()

parent f7834055
......@@ -3209,11 +3209,13 @@ static void polymer_updatewall(int16_t wallnum)
// yes, this function is messy and unefficient
// it also works, bitches
if (sectofwall < 0 || sectofwall >= numsectors || wallnum < 0 || wallnum > numwalls)
return;
sec = &sector[sectofwall];
if (sectofwall < 0 || sectofwall >= numsectors ||
wallnum < 0 || wallnum > numwalls ||
sec->wallptr > wallnum || wallnum >= (sec->wallptr + sec->wallnum))
if (sec->wallptr > wallnum || wallnum >= (sec->wallptr + sec->wallnum))
return; // yay, corrupt map
if (sec->floorz == sec->ceilingz)
......
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