Commit 4a9bf8a4 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(image-jpeg-p): Test for APPn markers in the range

#xe0..#xef.
parent 5d7a37fa
2001-08-10 Gerd Moellmann <gerd@gnu.org>
* image.el (image-jpeg-p): Test for APPn markers in the range
#xe0..#xef.
2001-08-09 Gerd Moellmann <gerd@gnu.org> 2001-08-09 Gerd Moellmann <gerd@gnu.org>
   
* desktop.el (desktop-save): Don't use concat to form a file * desktop.el (desktop-save): Don't use concat to form a file
......
...@@ -59,11 +59,12 @@ a non-nil value, TYPE is the image's type ") ...@@ -59,11 +59,12 @@ a non-nil value, TYPE is the image's type ")
(when (>= (+ i 2) len) (when (>= (+ i 2) len)
(throw 'jfif nil)) (throw 'jfif nil))
(let ((nbytes (+ (lsh (aref data (+ i 1)) 8) (let ((nbytes (+ (lsh (aref data (+ i 1)) 8)
(aref data (+ i 2))))) (aref data (+ i 2))))
(when (= (aref data i) #xe0) (code (aref data i)))
(when (and (>= code #xe0) (<= code #xef))
;; APP0 LEN1 LEN2 "JFIF\0" ;; APP0 LEN1 LEN2 "JFIF\0"
(throw 'jfif (string-match "\\`\xe0..JFIF\0" (throw 'jfif
(substring data i (+ i 10))))) (string-match "JFIF" (substring data i nbytes))))
(setq i (+ i 1 nbytes)))))))) (setq i (+ i 1 nbytes))))))))
......
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