// guard against integer overflow during multiplication which could result
// in allocating a too small buffer and then overflowing it
- const double bytesNeeded = w * h * sizeof(uint32);
+ const double bytesNeeded = (double)w * (double)h * sizeof(uint32);
if ( bytesNeeded >= wxUINT32_MAX )
{
if ( verbose )
return false;
}
- raster = (uint32*) _TIFFmalloc( bytesNeeded );
+ raster = (uint32*) _TIFFmalloc( (uint32)bytesNeeded );
if (!raster)
{