aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoakim Verona2013-08-19 17:07:07 +0200
committerJoakim Verona2013-08-19 17:07:07 +0200
commit3d284dbfc4bd3766bdc55d1ce816a0219636376e (patch)
treeec368734daaa22b717c72ec9bb9b925a0e47201b /src
parentaf31e21fc617018e7244fe0c9ceb43b1a5c0f52c (diff)
parent6da26928029c4598e75a344d57c08ca85dd95f2a (diff)
downloademacs-3d284dbfc4bd3766bdc55d1ce816a0219636376e.tar.gz
emacs-3d284dbfc4bd3766bdc55d1ce816a0219636376e.zip
merge from trunk
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/image.c28
2 files changed, 21 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c5a6f4d19c3..716b1177fd1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12013-08-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * image.c (imagemagick_get_animation_cache): Don't segfault on
4 each invocation.
5
12013-08-19 Paul Eggert <eggert@cs.ucla.edu> 62013-08-19 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 * image.c: Fix animation cache signature memory leak. 8 * image.c: Fix animation cache signature memory leak.
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