From: Lars Ingebrigtsen Date: Tue, 12 Apr 2022 12:45:13 +0000 (+0200) Subject: Store less data in the gif animation cache X-Git-Tag: emacs-29.0.90~1931^2~633 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7b67b9a5a2135d479dfe86f40109778ac5f99920;p=emacs.git 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). --- 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);