1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-25 10:47:00 +00:00

(image-jpeg-p): Don't search beyond length of data.

This commit is contained in:
John Paul Wallington 2003-08-26 15:38:36 +00:00
parent c577b2225a
commit 32b3c76642
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2003-08-26 John Paul Wallington <jpw@gnu.org>
* image.el (image-jpeg-p): Don't search beyond length of data.
2003-08-26 Martin Stjernholm <bug-cc-mode@gnu.org>
* progmodes/cc-cmds.el (c-electric-brace): Work around for a

View File

@ -67,7 +67,8 @@ We accept the tag Exif because that is the same format."
(when (and (>= code #xe0) (<= code #xef))
;; APP0 LEN1 LEN2 "JFIF\0"
(throw 'jfif
(string-match "JFIF\\|Exif" (substring data i (+ i nbytes)))))
(string-match "JFIF\\|Exif"
(substring data i (min (+ i nbytes) len)))))
(setq i (+ i 1 nbytes))))))))