summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-02-14 15:15:12 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-02-14 21:23:12 +0100
commit65e14b6c5283244e4ba02a269879d82085d793e6 (patch)
tree9379f653b80075a4fb176b2bb1f5e0e5c9bcf70a
parent13fd5d44c1d528c23bcade92241016195c37c453 (diff)
ofz#6334 Out-of-memory
Change-Id: I714d4b3c767a2e9244e4d5a0b608e3d7fd3002a3 Reviewed-on: https://gerrit.libreoffice.org/49741 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--filter/source/graphicfilter/ipsd/ipsd.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx
index 9a658ed13a40..344dbb6d3e07 100644
--- a/filter/source/graphicfilter/ipsd/ipsd.cxx
+++ b/filter/source/graphicfilter/ipsd/ipsd.cxx
@@ -107,6 +107,13 @@ bool PSDReader::ReadPSD(Graphic & rGraphic )
if ( !ImplReadHeader() )
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 );
mpBitmap.reset( new vcl::bitmap::RawBitmap( aBitmapSize ) );
if ( mpPalette && mbStatus )