* src/image.c (gif_load): Fix resetting the cache when we're out
of sync.
(anim_create_cache): Start from zero, not 1.
cache->handle = NULL;
cache->temp = NULL;
- cache->index = 0;
+ cache->index = -1;
cache->next = NULL;
cache->spec = spec;
return cache;
{
/* 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;
}
}