# HG changeset patch # User Gerd Moellmann # Date 997441113 0 # Node ID a679a282d5cb2f9d8d95ba1d295aa72302bf9180 # Parent 4804dd409fcc7a562316ed61dab58aab88d39661 (image-jpeg-p): Test for APPn markers in the range #xe0..#xef. diff -r 4804dd409fcc -r a679a282d5cb lisp/image.el --- a/lisp/image.el Fri Aug 10 09:24:29 2001 +0000 +++ b/lisp/image.el Fri Aug 10 10:58:33 2001 +0000 @@ -59,11 +59,12 @@ (when (>= (+ i 2) len) (throw 'jfif nil)) (let ((nbytes (+ (lsh (aref data (+ i 1)) 8) - (aref data (+ i 2))))) - (when (= (aref data i) #xe0) + (aref data (+ i 2)))) + (code (aref data i))) + (when (and (>= code #xe0) (<= code #xef)) ;; APP0 LEN1 LEN2 "JFIF\0" - (throw 'jfif (string-match "\\`\xe0..JFIF\0" - (substring data i (+ i 10))))) + (throw 'jfif + (string-match "JFIF" (substring data i nbytes)))) (setq i (+ i 1 nbytes))))))))