adds missing checks on TIFFGetField in tiffcrop tool (fixes #170)
This commit is contained in:
parent
91d4a30dbc
commit
47656ccb3f
@ -1334,9 +1334,10 @@ static int writeBufferToSeparateTiles (TIFF* out, uint8* buf, uint32 imagelength
|
|||||||
if (obuf == NULL)
|
if (obuf == NULL)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
TIFFGetField(out, TIFFTAG_TILELENGTH, &tl);
|
if( !TIFFGetField(out, TIFFTAG_TILELENGTH, &tl) ||
|
||||||
TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw);
|
!TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw) ||
|
||||||
TIFFGetField(out, TIFFTAG_BITSPERSAMPLE, &bps);
|
!TIFFGetField(out, TIFFTAG_BITSPERSAMPLE, &bps) )
|
||||||
|
return 1;
|
||||||
|
|
||||||
if( imagewidth == 0 ||
|
if( imagewidth == 0 ||
|
||||||
(uint32)bps * (uint32)spp > TIFF_UINT32_MAX / imagewidth ||
|
(uint32)bps * (uint32)spp > TIFF_UINT32_MAX / imagewidth ||
|
||||||
|
Loading…
Reference in New Issue
Block a user