aboutsummaryrefslogtreecommitdiffstats
path: root/exif.c
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2013-10-05 17:37:00 +0200
committerBert Münnich <ber.t@posteo.de>2013-10-05 17:37:00 +0200
commit1b089bc2fa36fdbd69af25a15ec5ee3e8963b80d (patch)
tree1f401ffc8efbe9e0a5ae97227940261949b27ff0 /exif.c
parent5dea695c719dc2ee61e7677d553f16c1c4c3ac52 (diff)
downloadnsxiv-1b089bc2fa36fdbd69af25a15ec5ee3e8963b80d.tar.zst
Seek over EXIF APP0 frame instead of reading and discarding it
Diffstat (limited to 'exif.c')
-rw-r--r--exif.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/exif.c b/exif.c
index 098fa72..424d36d 100644
--- a/exif.c
+++ b/exif.c
@@ -79,9 +79,10 @@ int exif_orientation(const fileinfo_t *file)
goto abort;
if (s_read(fd, file->name, data, 4) < 0)
goto abort;
- if (btous(data, order) == JPEG_MARKER_APP0){
+
+ if (btous(data, order) == JPEG_MARKER_APP0) {
len = btous(data + 2, order);
- if (s_read(fd, file->name, data, len - 2) < 0)
+ if (lseek(fd, len - 2, SEEK_CUR) == (off_t) -1)
goto abort;
if (s_read(fd, file->name, data, 4) < 0)
goto abort;