diff --git a/src/common/imagtiff.cpp b/src/common/imagtiff.cpp index 44a8fb3784..fb8a78a3a6 100644 --- a/src/common/imagtiff.cpp +++ b/src/common/imagtiff.cpp @@ -301,7 +301,7 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos // 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 >= 4294967295U /* UINT32_MAX */ ) { if ( verbose )