From 9e1f3a964f8fbc2f19aa0c9e1eef1d58b9a1f497 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_8_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 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 )