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

(valid_image_p): Protect better against invalid image

specifications.
parent 68b7eaa9
...@@ -5318,11 +5318,22 @@ valid_image_p (object) ...@@ -5318,11 +5318,22 @@ valid_image_p (object)
if (CONSP (object) && EQ (XCAR (object), Qimage)) if (CONSP (object) && EQ (XCAR (object), Qimage))
{ {
Lisp_Object symbol = Fplist_get (XCDR (object), QCtype); Lisp_Object tem;
struct image_type *type = lookup_image_type (symbol);
for (tem = XCDR (object); CONSP (tem); tem = XCDR (tem))
if (type) if (EQ (XCAR (tem), QCtype))
valid_p = type->valid_p (object); {
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; 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