diff --git a/libImaging/TiffDecode.c b/libImaging/TiffDecode.c index 32d844103..b9b61e48f 100644 --- a/libImaging/TiffDecode.c +++ b/libImaging/TiffDecode.c @@ -222,8 +222,8 @@ int ImagingLibTiffDecode(Imaging im, ImagingCodecState state, UINT8* buffer, int if (clientstate->ifd){ int rv; - unsigned int ifdoffset = clientstate->ifd; - TRACE(("reading tiff ifd %d\n", ifdoffset)); + uint32 ifdoffset = clientstate->ifd; + TRACE(("reading tiff ifd %u\n", ifdoffset)); rv = TIFFSetSubDirectory(tiff, ifdoffset); if (!rv){ TRACE(("error in TIFFSetSubDirectory")); diff --git a/libImaging/TiffDecode.h b/libImaging/TiffDecode.h index ea977d17d..2c8eeecae 100644 --- a/libImaging/TiffDecode.h +++ b/libImaging/TiffDecode.h @@ -32,10 +32,13 @@ typedef struct { toff_t loc; /* toff_t == uint32 */ tsize_t size; /* tsize_t == int32 */ int fp; - int ifd; /* offset of the ifd, used for multipage */ - TIFF *tiff; /* Used in write */ + uint32 ifd; /* offset of the ifd, used for multipage + * Should be uint32 for libtiff 3.9.x + * uint64 for libtiff 4.0.x + */ + TIFF *tiff; /* Used in write */ toff_t eof; - int flrealloc; /* may we realloc */ + int flrealloc;/* may we realloc */ } TIFFSTATE;