emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r108146: Backport fix for Bug#1246


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r108146: Backport fix for Bug#12463 from trunk.
Date: Fri, 21 Sep 2012 11:55:23 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108146
committer: Chong Yidong <address@hidden>
branch nick: emacs-24
timestamp: Fri 2012-09-21 11:55:23 +0800
message:
  Backport fix for Bug#12463 from trunk.
  
  * image.c (define_image_type): Avoid adding duplicate types to
  image_types.  Suggested by Jörg Walter.
modified:
  src/ChangeLog
  src/image.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-09-20 08:28:48 +0000
+++ b/src/ChangeLog     2012-09-21 03:55:23 +0000
@@ -1,3 +1,8 @@
+2012-09-21  Chong Yidong  <address@hidden>
+
+       * image.c (define_image_type): Avoid adding duplicate types to
+       image_types (Bug#12463).  Suggested by Jörg Walter.
+
 2012-09-20  YAMAMOTO Mitsuharu  <address@hidden>
 
        * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.

=== modified file 'src/image.c'
--- a/src/image.c       2012-02-15 06:40:08 +0000
+++ b/src/image.c       2012-09-21 03:55:23 +0000
@@ -597,9 +597,15 @@
     success = Qnil;
   else
     {
+      struct image_type *p;
+      Lisp_Object target_type = *(type->type);
+      for (p = image_types; p; p = p->next)
+       if (EQ (*(p->type), target_type))
+         return Qt;
+
       /* Make a copy of TYPE to avoid a bus error in a dumped Emacs.
          The initialized data segment is read-only.  */
-      struct image_type *p = (struct image_type *) xmalloc (sizeof *p);
+      p = (struct image_type *) xmalloc (sizeof *p);
       memcpy (p, type, sizeof *p);
       p->next = image_types;
       image_types = p;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]