Bug 2385 - _tiffSizeProc may not work correctly under Windows
: _tiffSizeProc may not work correctly under Windows
Status: RESOLVED LATER
: libtiff
default
: 4.0.0
: PC Windows XP
: P2 minor
: ---
Assigned To:
:
:
: migrated_to_gitlab
:
:
  Show dependency treegraph
 
Reported: 2012-04-26 09:07 by
Modified: 2019-10-01 14:19 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2012-04-26 09:07:59
As a corrolary to LibTIFF Bug 2384, the code of _tiffSizeProc also seems to be
incorrect, although I have not yet seen an instance where the problem occurs in
our software.  The problem is that the member st_size of a struct stat under
Windows is 32 bits. Under Windows, the correct data structure to support files
larger than 4 GiB would be struct _stati64 and the correct function to call
would be _fstati64.

The minimal patch would be to insert the following code into tif_unix.c, e.g.,
after the line #include "tiffiop.h":

#if defined(_WIN32)
#define fstat _fstati64
#define stat _stati64
#endif

However, the redefinition of stat is actually a gross hack. It would be better
to have a typedef for a type that is struct _stati64 under Windows and struct
stat on other systems in an appropriate header file.
------- Comment #1 From 2019-10-01 14:19:37 -------
Bugzilla is no longer used for tracking libtiff issues. Remaining open tickets,
such as this one, have been migrated to the libtiff GitLab instance at
https://gitlab.com/libtiff/libtiff/issues .

The migrated tickets have their summary prefixed with [BZ#XXXX] where XXXX is
the initial Bugzilla issue number.