Kaydet (Commit) 65e14b6c authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz#6334 Out-of-memory

Change-Id: I714d4b3c767a2e9244e4d5a0b608e3d7fd3002a3
Reviewed-on: https://gerrit.libreoffice.org/49741Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 13fd5d44
...@@ -107,6 +107,13 @@ bool PSDReader::ReadPSD(Graphic & rGraphic ) ...@@ -107,6 +107,13 @@ bool PSDReader::ReadPSD(Graphic & rGraphic )
if ( !ImplReadHeader() ) if ( !ImplReadHeader() )
return false; return false;
if (mbStatus)
{
sal_uInt32 nResult;
if (o3tl::checked_multiply(mpFileHeader->nColumns, mpFileHeader->nRows, nResult) || nResult > SAL_MAX_INT32/2/3)
return false;
}
Size aBitmapSize( mpFileHeader->nColumns, mpFileHeader->nRows ); Size aBitmapSize( mpFileHeader->nColumns, mpFileHeader->nRows );
mpBitmap.reset( new vcl::bitmap::RawBitmap( aBitmapSize ) ); mpBitmap.reset( new vcl::bitmap::RawBitmap( aBitmapSize ) );
if ( mpPalette && mbStatus ) if ( mpPalette && mbStatus )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment