Commit 1783ffa2 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(valid_image_p): Protect better against invalid image

parent 68b7eaa9
......@@ -5318,11 +5318,22 @@ valid_image_p (object)
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);
return valid_p;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment