From c9a8c3b2bcb26182fe2882ca08258a9dbe5cdd89 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 28 Nov 2016 07:51:32 +0100 Subject: [PATCH] fixed bug that causes a crash with faulty GIC image size definitions --- src/init.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/init.c b/src/init.c index c480850c..28dcd41c 100644 --- a/src/init.c +++ b/src/init.c @@ -1344,13 +1344,13 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, if (parameter[GFX_ARG_TILE_SIZE] != ARG_UNDEFINED_VALUE) { - anim_frames_per_row = src_image_width / g->tile_size; - anim_frames_per_col = src_image_height / g->tile_size; + anim_frames_per_row = MAX(1, src_image_width / g->tile_size); + anim_frames_per_col = MAX(1, src_image_height / g->tile_size); } else { - anim_frames_per_row = src_image_width / g->width; - anim_frames_per_col = src_image_height / g->height; + anim_frames_per_row = MAX(1, src_image_width / g->width); + anim_frames_per_col = MAX(1, src_image_height / g->height); } g->src_image_width = src_image_width; -- 2.34.1