mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Fix indexing out-of-bounds via an entity's drawframe
I tracked down all the functions that took in an entity's drawframe and made sure that no matter what value an entity's drawframe was, the game would never segfault.
This commit is contained in:
@@ -2816,7 +2816,8 @@ void editorrender()
|
||||
SDL_FillRect(graphics.ghostbuffer, NULL, SDL_MapRGBA(graphics.ghostbuffer->format, 0, 0, 0, 0));
|
||||
for (int i = 0; i < (int)ed.ghosts.size(); i++) {
|
||||
if (i <= ed.currentghosts) { // We don't want all of them to show up at once :)
|
||||
if (ed.ghosts[i].rx != ed.levx || ed.ghosts[i].ry != ed.levy)
|
||||
if (ed.ghosts[i].rx != ed.levx || ed.ghosts[i].ry != ed.levy
|
||||
|| !INBOUNDS(ed.ghosts[i].frame, graphics.sprites))
|
||||
continue;
|
||||
point tpoint;
|
||||
tpoint.x = ed.ghosts[i].x;
|
||||
|
||||
Reference in New Issue
Block a user