summaryrefslogtreecommitdiff
path: root/lisp/image.el
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2001-08-10 10:59:06 +0000
committerGerd Moellmann <gerd@gnu.org>2001-08-10 10:59:06 +0000
commit4a9bf8a43f4d5589318785c4f3b0f0cdd9f43f1b (patch)
treed1132393f279770943a0d3d492ff3c9896e3e14a /lisp/image.el
parent5d7a37fa13755c4de001d9a42ea6a2a71c471b1a (diff)
downloademacs-4a9bf8a43f4d5589318785c4f3b0f0cdd9f43f1b.tar.gz
(image-jpeg-p): Test for APPn markers in the range
#xe0..#xef.
Diffstat (limited to 'lisp/image.el')
-rw-r--r--lisp/image.el9
1 files changed, 5 insertions, 4 deletions
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))))))))