Commit 6da26928 authored by Lars Magne Ingebrigtsen's avatar Lars Magne Ingebrigtsen
Browse files

* image.c (imagemagick_get_animation_cache): Don't segfault on each invocation.

Bug introduced by 2013-08-19T07:01:37Z!eggert@cs.ucla.edu, which obviously hadn't even been
tested once.
parent 6e64a12b
2013-08-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
* image.c (imagemagick_get_animation_cache): Don't segfault on
each invocation.
2013-08-19 Paul Eggert <eggert@cs.ucla.edu>
* image.c: Fix animation cache signature memory leak.
......
......@@ -7927,23 +7927,27 @@ imagemagick_get_animation_cache (MagickWand *wand)
{
char *signature = MagickGetImageSignature (wand);
struct animation_cache *cache;
struct animation_cache **pcache = &animation_cache;
struct animation_cache **pcache;
imagemagick_prune_animation_cache ();
cache = animation_cache;
for (pcache = &animation_cache; *pcache; pcache = &cache->next)
if (! animation_cache)
animation_cache = cache = imagemagick_create_cache (signature);
else
{
cache = *pcache;
if (! cache)
{
*pcache = cache = imagemagick_create_cache (signature);
break;
}
if (strcmp (signature, cache->signature) == 0)
for (pcache = &animation_cache; *pcache; pcache = &cache->next)
{
DestroyString (signature);
break;
cache = *pcache;
if (! cache)
{
animation_cache = cache = imagemagick_create_cache (signature);
break;
}
if (strcmp (signature, cache->signature) == 0)
{
DestroyString (signature);
break;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment