tiffdec: restore libtiff 3.9.x compatibility

use tsize_t which is equivalent (for now) to tmsize_t added in version 4

Change-Id: I7489ef7b39d9a3692a4b952de22476b245240ed1
This commit is contained in:
James Zern 2016-12-13 22:50:28 -08:00
parent b2f77b57a9
commit 31ca2a8098

View File

@ -153,9 +153,9 @@ int ReadTIFF(const uint8_t* const data, size_t data_size,
}
// _Tiffmalloc uses a signed type for size.
alloc_size = (int64_t)((uint64_t)width * height * sizeof(*raster));
if (alloc_size < 0 || alloc_size != (tmsize_t)alloc_size) goto End;
if (alloc_size < 0 || alloc_size != (tsize_t)alloc_size) goto End;
raster = (uint32*)_TIFFmalloc((tmsize_t)alloc_size);
raster = (uint32*)_TIFFmalloc((tsize_t)alloc_size);
if (raster != NULL) {
if (TIFFReadRGBAImageOriented(tif, width, height, raster,
ORIENTATION_TOPLEFT, 1)) {