]> git.saurik.com Git - wxWidgets.git/commitdiff
correct the fix for avoiding the integer multiplication overflow to really work
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 4 Jun 2009 22:28:48 +0000 (22:28 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 4 Jun 2009 22:28:48 +0000 (22:28 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60897 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/imagtiff.cpp

index 0df1139d8f87aaf4bb6549764168edf5da9a982c..2b48f30b6df8ae0b5958b738cb94dfb8d30eda8d 100644 (file)
@@ -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 >= wxUINT32_MAX )
     {
         if ( verbose )