8000 libtiff 4.7 now returns -1 for some warnings · libvips/libvips@140d14f · GitHub
[go: up one dir, main page]

Skip to content

Commit 140d14f

Browse files
committed
libtiff 4.7 now returns -1 for some warnings
Don't bail out if TIFFReadScanline() and TIFFReadEncodedStrip() return -1. libtiff 4.7.0 and maybe earlier have started returning error values for truncated strips. Maybe other API points now return error codes for warnings too? see #4317
1 parent 3ba36ce commit 140d14f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- heifsave: prevent use of AV1 intra block copy feature [lovell]
1111
- threadpool: improve cooperative downsizing [kleisauke]
1212
- fix alpha shift during colourspace conversions [frederikrosenberg]
13+
- improve error handling with libtiff 4.7 [CrispinStichartFNSB]
1314

1415
10/10/24 8.16.0
1516

libvips/foreign/tiff2vips.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -686,11 +686,10 @@ rtiff_strip_read(Rtiff *rtiff, int strip, tdata_t buf)
686686
length = TIFFReadEncodedStrip(rtiff->tiff,
687687
strip, buf, (tsize_t) -1);
688688

689-
if (length == -1) {
690-
vips_foreign_load_invalidate(rtiff->out);
691-
vips_error("tiff2vips", "%s", _("read error"));
692-
return -1;
693-
}
689+
/* We get a length == -1 return for warnings with libtiff 4.7.0, we need
690+
* to ignore it.
691+
*/
692+
(void) length;
694693

695694
return 0;
696695
}

0 commit comments

Comments
 (0)
0