1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00

Fix parsing error in exif

* lisp/image/exif.el (exif--parse-exif-chunk): The offset is a
four-byte number.  Reported by Alan Light <lightalan@gmail.com>.
This commit is contained in:
Lars Ingebrigtsen 2020-12-11 15:16:05 +01:00
parent 004d7e97e2
commit 72bcc6f988

View File

@ -165,7 +165,7 @@ If the orientation isn't present in the data, return nil."
;; Another magical number.
(unless (= (exif--read-number 2 le) #x002a)
(signal 'exif-error "Invalid TIFF header length"))
(let ((offset (exif--read-number 2 le)))
(let ((offset (exif--read-number 4 le)))
;; Jump to where the IFD (directory) starts and parse it.
(when (> (1+ offset) (point-max))
(signal 'exif-error "Invalid IFD (directory) offset"))