1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Fix out-of-bounds array access in findstartpoint()

Out-of-bounds array access is Undefined Behavior, which means Bad
Things.

In this particular case, it was indexing an array by using the
`testeditor` variable. Which is fine, except it was indexing that array
*in a conditional that only happens if `testeditor` is -1*. So it was
indexing an array at position -1, which is Out of Bounds and is Not
Good.
This commit is contained in:
Info Teddy 2020-01-21 21:43:01 -08:00 committed by Ethan Lee
parent 5934802fca
commit 31efc9b3ce

View file

@ -1595,7 +1595,7 @@ void editorclass::findstartpoint(Game& game)
game.edsavery = 100; game.edsavery = 100;
game.edsavegc = 0; game.edsavegc = 0;
game.edsavey--; game.edsavey--;
game.edsavedir=1-edentity[testeditor].p1; game.edsavedir=1;
} }
else else
{ {