From ba2137d52850f275c82c5707a66ababb216ebf18 Mon Sep 17 00:00:00 2001 From: John Popplewell Date: Mon, 31 Dec 2007 03:03:49 +0000 Subject: [PATCH] Avoid crashing in mirror_starter() when there is no starter. --- src/tuxpaint.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 3cb5c6187..0d04aa72a 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -11061,13 +11061,16 @@ static void load_current(void) { autoscale_copy_smear_free(tmp, canvas, SDL_BlitSurface); load_starter_id(file_id); - load_starter(starter_id); - - if (starter_mirrored) - mirror_starter(); - - if (starter_flipped) - flip_starter(); + if (starter_id[0] != '\0') + { + load_starter(starter_id); + + if (starter_mirrored) + mirror_starter(); + + if (starter_flipped) + flip_starter(); + } } free(fname);