diff --git a/src/common/imagtiff.cpp b/src/common/imagtiff.cpp index 7c1276bedf..48eaf3ca72 100644 --- a/src/common/imagtiff.cpp +++ b/src/common/imagtiff.cpp @@ -276,7 +276,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 )