aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/image.c b/src/image.c
index 68d78fc9eef..ec89ee076d9 100644
--- a/src/image.c
+++ b/src/image.c
@@ -7927,23 +7927,27 @@ imagemagick_get_animation_cache (MagickWand *wand)
7927{ 7927{
7928 char *signature = MagickGetImageSignature (wand); 7928 char *signature = MagickGetImageSignature (wand);
7929 struct animation_cache *cache; 7929 struct animation_cache *cache;
7930 struct animation_cache **pcache = &animation_cache; 7930 struct animation_cache **pcache;
7931 7931
7932 imagemagick_prune_animation_cache (); 7932 imagemagick_prune_animation_cache ();
7933 cache = animation_cache;
7934 7933
7935 for (pcache = &animation_cache; *pcache; pcache = &cache->next) 7934 if (! animation_cache)
7935 animation_cache = cache = imagemagick_create_cache (signature);
7936 else
7936 { 7937 {
7937 cache = *pcache; 7938 for (pcache = &animation_cache; *pcache; pcache = &cache->next)
7938 if (! cache)
7939 {
7940 *pcache = cache = imagemagick_create_cache (signature);
7941 break;
7942 }
7943 if (strcmp (signature, cache->signature) == 0)
7944 { 7939 {
7945 DestroyString (signature); 7940 cache = *pcache;
7946 break; 7941 if (! cache)
7942 {
7943 animation_cache = cache = imagemagick_create_cache (signature);
7944 break;
7945 }
7946 if (strcmp (signature, cache->signature) == 0)
7947 {
7948 DestroyString (signature);
7949 break;
7950 }
7947 } 7951 }
7948 } 7952 }
7949 7953