merge from trunk
This commit is contained in:
commit
3d284dbfc4
2 changed files with 21 additions and 12 deletions
|
@ -1,3 +1,8 @@
|
|||
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.
|
||||
|
|
28
src/image.c
28
src/image.c
|
@ -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)
|
||||
for (pcache = &animation_cache; *pcache; pcache = &cache->next)
|
||||
{
|
||||
*pcache = cache = imagemagick_create_cache (signature);
|
||||
break;
|
||||
}
|
||||
if (strcmp (signature, cache->signature) == 0)
|
||||
{
|
||||
DestroyString (signature);
|
||||
break;
|
||||
cache = *pcache;
|
||||
if (! cache)
|
||||
{
|
||||
animation_cache = cache = imagemagick_create_cache (signature);
|
||||
break;
|
||||
}
|
||||
if (strcmp (signature, cache->signature) == 0)
|
||||
{
|
||||
DestroyString (signature);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue