From 4a9bf8a43f4d5589318785c4f3b0f0cdd9f43f1b Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Fri, 10 Aug 2001 10:59:06 +0000 Subject: [PATCH] (image-jpeg-p): Test for APPn markers in the range #xe0..#xef. --- lisp/ChangeLog | 5 +++++ lisp/image.el | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fbbf08c9a84..2819ebcba55 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2001-08-10 Gerd Moellmann + + * image.el (image-jpeg-p): Test for APPn markers in the range + #xe0..#xef. + 2001-08-09 Gerd Moellmann * desktop.el (desktop-save): Don't use concat to form a file diff --git a/lisp/image.el b/lisp/image.el index 3e61b100cee..f08db3879b1 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -59,11 +59,12 @@ a non-nil value, TYPE is the image's type ") (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)))))))) -- 2.39.2