summaryrefslogtreecommitdiff
path: root/lisp/image.el
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2001-08-10 10:58:33 +0000
committerGerd Moellmann <gerd@gnu.org>2001-08-10 10:58:33 +0000
commit03d5c1a1557d165b501805382b5078419c7b6284 (patch)
treec5942abac6f8cf3faa1287e5e7ab6e7bb5d6b9f1 /lisp/image.el
parenta526dcd69598d50f96287bbeb76ff2cd312881b6 (diff)
downloademacs-03d5c1a1557d165b501805382b5078419c7b6284.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))))))))