2019.10.01 18:01 "[Tiff] TIFF_IO_MAX too large for Windows XP", by David C. Partridge

2019.10.01 18:01 "[Tiff] TIFF_IO_MAX too large for Windows XP", by David C. Partridge

After a lot of digging I found out why my code wasn't working when run in Windows XP (It was working fine of Window 7 and up)

In tif_unix.c the read() and write() calls were using TIFF_IO_MAX to set the maximum buffer size. Unfortunately when they were called with a request to read a large file the requested number of bytes to read was 170,769,911 bytes which resulted in read() returning -1 with errno set to EINVAL.

For now I have changed the #define for TIFF_IO_MAX thus:

//#define TIFF_IO_MAX 2147483647U
#define TIFF_IO_MAX USHRT_MAX

which limits the request size to 65535.

Does anyone know what the actual limit was on Windows XP? If higher than 65535 I'd like to increase the defined limit.

Would the libtiff maintainers consider changing this to an appropriate smaller value?

Thanks

David