summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2022-11-01 16:29:38 +0100
committerLouis Burda <quent.burda@gmail.com>2022-11-01 16:29:38 +0100
commitd40bb519ef34f20b30762cf5d32f0078b960c706 (patch)
tree28e23a67e2340ba28036731c74e5555115c54bae
parent263fdaa4366782d38c7546b97f79bd76419913f8 (diff)
downloadbgdraw-d40bb519ef34f20b30762cf5d32f0078b960c706.tar.gz
bgdraw-d40bb519ef34f20b30762cf5d32f0078b960c706.zip
Fix default width and height assignment for gif
-rw-r--r--bgdraw.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bgdraw.c b/bgdraw.c
index 7f61df0..9160480 100644
--- a/bgdraw.c
+++ b/bgdraw.c
@@ -261,6 +261,11 @@ load_img(struct image *img)
if (!frames || !img->framecnt)
errx(1, "IMG %s: Failed to load gif image", img->name);
+ if (!img->w || !img->h) {
+ img->w = width;
+ img->h = height;
+ }
+
img->frames = malloc(sizeof(XImage*) * img->framecnt);
if (!img->frames) err(1, "malloc");