changeset 38542:27905f0c73b7

(valid_image_p): Protect better against invalid image specifications.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 24 Jul 2001 11:28:18 +0000
parents 2540b694650b
children 0f1f45424aef
files src/xfns.c
diffstat 1 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Tue Jul 24 11:21:40 2001 +0000
+++ b/src/xfns.c	Tue Jul 24 11:28:18 2001 +0000
@@ -5318,11 +5318,22 @@
   
   if (CONSP (object) && EQ (XCAR (object), Qimage))
     {
-      Lisp_Object symbol = Fplist_get (XCDR (object), QCtype);
-      struct image_type *type = lookup_image_type (symbol);
-      
-      if (type)
-	valid_p = type->valid_p (object);
+      Lisp_Object tem;
+
+      for (tem = XCDR (object); CONSP (tem); tem = XCDR (tem))
+	if (EQ (XCAR (tem), QCtype))
+	  {
+	    tem = XCDR (tem);
+	    if (CONSP (tem) && SYMBOLP (XCAR (tem)))
+	      {
+		struct image_type *type;
+		type = lookup_image_type (XCAR (tem));
+		if (type)
+		  valid_p = type->valid_p (object);
+	      }
+	    
+	    break;
+	  }
     }
 
   return valid_p;