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
This commit is contained in:
@@ -301,7 +301,7 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
|
|||||||
|
|
||||||
// guard against integer overflow during multiplication which could result
|
// guard against integer overflow during multiplication which could result
|
||||||
// in allocating a too small buffer and then overflowing it
|
// 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 ( bytesNeeded >= 4294967295U /* UINT32_MAX */ )
|
||||||
{
|
{
|
||||||
if ( verbose )
|
if ( verbose )
|
||||||
|
Reference in New Issue
Block a user