diff options
| author | Simon Tatham <anakin@pobox.com> | 2011-05-11 18:11:28 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2011-05-11 18:11:28 +0000 |
| commit | 004ef734801aa3b0bb3e1a73aad0e59ac12d9514 (patch) | |
| tree | c49b56a9b36722368b1e30d24730b2b309c5809d /loopy.c | |
| parent | bd539ae8707422d82955a4838585e17fd01c6975 (diff) | |
| download | puzzles-004ef734801aa3b0bb3e1a73aad0e59ac12d9514.zip puzzles-004ef734801aa3b0bb3e1a73aad0e59ac12d9514.tar.gz puzzles-004ef734801aa3b0bb3e1a73aad0e59ac12d9514.tar.bz2 puzzles-004ef734801aa3b0bb3e1a73aad0e59ac12d9514.tar.xz | |
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]
Diffstat (limited to 'loopy.c')
| -rw-r--r-- | loopy.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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 |