From 74f25a438053301f98b7e160a1b9d9073bb10dbb Mon Sep 17 00:00:00 2001 From: Dino Date: Sun, 5 Feb 2023 20:28:46 -0500 Subject: [PATCH] Fix crash in load_sprite(). Ticket #47318 --- client/tilespec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/tilespec.c b/client/tilespec.c index b59a8428ec..3bc8213c5f 100644 --- a/client/tilespec.c +++ b/client/tilespec.c @@ -2659,7 +2659,8 @@ static struct sprite *load_sprite(struct tileset *t, const char *tag_name, if (scale) { s = load_gfx_file(ss->file, flag); - get_sprite_dimensions(s, &w, &h); + if (s) + get_sprite_dimensions(s, &w, &h); ss->sprite = crop_sprite(s, 0, 0, w, h, NULL, -1, -1, t->scale, smooth); free_sprite(s); -- 2.31.0