mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
Fix segfault in Loopy printing, introduced when I added the dynamic
arrays 'textx' and 'texty' to the game_drawstate but failed to initialise them in the temporary drawstate used by game_print(). Thanks to Arun Giridhar for spotting this. [originally from svn r9173]
This commit is contained in:
7
loopy.c
7
loopy.c
@ -3805,6 +3805,10 @@ static void game_print(drawing *dr, game_state *state, int tilesize)
|
||||
grid *g = state->game_grid;
|
||||
|
||||
ds->tilesize = tilesize;
|
||||
ds->textx = snewn(g->num_faces, int);
|
||||
ds->texty = snewn(g->num_faces, int);
|
||||
for (i = 0; i < g->num_faces; i++)
|
||||
ds->textx[i] = ds->texty[i] = -1;
|
||||
|
||||
for (i = 0; i < g->num_dots; i++) {
|
||||
int x, y;
|
||||
@ -3874,6 +3878,9 @@ static void game_print(drawing *dr, game_state *state, int tilesize)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sfree(ds->textx);
|
||||
sfree(ds->texty);
|
||||
}
|
||||
|
||||
#ifdef COMBINED
|
||||
|
Reference in New Issue
Block a user