* image.c (define_image_type): Avoid adding duplicate types to
image_types. Suggested by Jörg Walter.
+2012-09-21 Chong Yidong <cyd@gnu.org>
+
+ * image.c (define_image_type): Avoid adding duplicate types to
+ image_types (Bug#12463). Suggested by Jörg Walter.
+
2012-09-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
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;