From c71beb790aa0f665c458c8e6bc68195c7a4ab314 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 4 Jun 2009 22:28:48 +0000 Subject: [PATCH] correct the fix for avoiding the integer multiplication overflow to really work git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_9_0_BRANCH@60897 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/imagtiff.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 )