emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 8e1c0054b3: Fix thinko in the anim cache


From: Lars Ingebrigtsen
Subject: master 8e1c0054b3: Fix thinko in the anim cache
Date: Tue, 12 Apr 2022 06:12:40 -0400 (EDT)

branch: master
commit 8e1c0054b3545863e41d51c95b69ab7fdb0cc61d
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix thinko in the anim cache
    
    * src/image.c (gif_load): Fix resetting the cache when we're out
    of sync.
    (anim_create_cache): Start from zero, not 1.
---
 src/image.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/image.c b/src/image.c
index 38c3f1496a..f6143f5b46 100644
--- a/src/image.c
+++ b/src/image.c
@@ -2847,7 +2847,7 @@ anim_create_cache (Lisp_Object spec)
   cache->handle = NULL;
   cache->temp = NULL;
 
-  cache->index = 0;
+  cache->index = -1;
   cache->next = NULL;
   cache->spec = spec;
   return cache;
@@ -8825,15 +8825,14 @@ gif_load (struct frame *f, struct image *img)
     {
       /* If this is an animated image, create a cache for it.  */
       cache = anim_get_animation_cache (img->spec);
+      /* We have an old cache entry, so use it.  */
       if (cache->handle)
        {
-         /* We have an old cache entry, and it looks correct, so use
-            it.  */
-         if (cache->index == idx - 1)
-           {
-             gif = cache->handle;
-             pixmap = cache->temp;
-           }
+         gif = cache->handle;
+         pixmap = cache->temp;
+         /* We're out of sync, so start from the beginning.  */
+         if (cache->index != idx - 1)
+           cache->index = -1;
        }
     }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]