From 7b67b9a5a2135d479dfe86f40109778ac5f99920 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 12 Apr 2022 14:45:13 +0200 Subject: [PATCH] Store less data in the gif animation cache * src/image.c (gif_load): Only start a cache if we're have an :index entry (which means that we're trying to animate something). --- src/image.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/image.c b/src/image.c index f56d02bf198..b6edcf96a0b 100644 --- a/src/image.c +++ b/src/image.c @@ -8814,14 +8814,12 @@ gif_load (struct frame *f, struct image *img) EMACS_INT idx = -1; int gif_err; struct anim_cache* cache = NULL; - /* Which sub-image are we to display? */ - { - Lisp_Object image_number = image_spec_value (img->spec, QCindex, NULL); - idx = FIXNUMP (image_number) ? XFIXNAT (image_number) : 0; - } + Lisp_Object image_number = image_spec_value (img->spec, QCindex, NULL); + + idx = FIXNUMP (image_number) ? XFIXNAT (image_number) : 0; - if (idx != -1) + if (!NILP (image_number)) { /* If this is an animated image, create a cache for it. */ cache = anim_get_animation_cache (img->spec); -- 2.39.5