AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
August 2017

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2017.08.02 15:00 "Error handling in Read/Write/Seek", by Nicolas Ruff
2017.08.02 15:26 "Re: Error handling in Read/Write/Seek", by Bob Friesenhahn
2017.08.03 15:04 "Re: Error handling in Read/Write/Seek", by Nicolas Ruff
2017.08.03 15:23 "Re: Error handling in Read/Write/Seek", by Bob Friesenhahn
2017.08.04 15:27 "Re: Error handling in Read/Write/Seek", by Even Rouault
2017.08.07 15:53 "Re: Error handling in Read/Write/Seek", by Nicolas Ruff
2017.09.06 07:48 "Re: Error handling in Read/Write/Seek", by Nicolas Ruff
2017.09.06 10:32 "Re: Error handling in Read/Write/Seek", by Even Rouault
2017.09.06 13:16 "Re: Error handling in Read/Write/Seek", by Nicolas Ruff
2017.09.07 14:06 "Re: Error handling in Read/Write/Seek", by Even Rouault
2017.09.08 07:50 "Re: Error handling in Read/Write/Seek", by Nicolas Ruff

2017.09.06 13:16 "Re: Error handling in Read/Write/Seek", by Nicolas Ruff

> One potential issue I can see is that we use off_t here, which isn't
> necessarily what is use in the implementation of the file system callbacks.
> For example tif_unix.c uses _TIFF_off_t. I'm wondering for example if off_t
> might not be 32 bit only in some circumstances when evaluated in libtiff
> non-IO code.

Indeed off_t is 32-bit on 32-bit Linux systems.

TIFFSeekProc is typedef'ed to (thandle_t, toff_t, int).

And toff_t is an alias for uint64, regardless of the platform (from tiffio.h).

tif_unix.c implementation adheres to this type definition:
_tiffSeekProc(thandle_t fd, uint64 off, int whence)

So the proper patch should be:

- (TIFFSeekFile((tif),(off),SEEK_SET)==(off))
+ (((int64)(off) >= 0) && TIFFSeekFile((tif),(off),SEEK_SET)==(off))

Thank you for catching this!