summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-01-30 12:31:55 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-01-30 15:40:19 +0100
commit3f726abf5c4c32619f93d4982f8fb1e07619ba40 (patch)
tree72bbb56bd77f3429c3cac87b14428f3adcb27488 /filter
parent21299f54815584951b844537749944d168882dba (diff)
ofz#12666 fuzzing timeout
Change-Id: I7892bef62c93dd30d5a7d9605e0e6d62fdd35cb1 Reviewed-on: https://gerrit.libreoffice.org/67133 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/icgm/bitmap.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/filter/source/graphicfilter/icgm/bitmap.cxx b/filter/source/graphicfilter/icgm/bitmap.cxx
index bca6ec869ff1..375612b19e9b 100644
--- a/filter/source/graphicfilter/icgm/bitmap.cxx
+++ b/filter/source/graphicfilter/icgm/bitmap.cxx
@@ -19,6 +19,8 @@
#include "main.hxx"
+#include <sal/log.hxx>
+#include <unotools/configmgr.hxx>
#include <vcl/BitmapTools.hxx>
#include <memory>
@@ -308,6 +310,12 @@ bool CGMBitmap::ImplGetDimensions( CGMBitmapDescriptor& rDesc )
void CGMBitmap::ImplInsert( CGMBitmapDescriptor const & rSource, CGMBitmapDescriptor& rDest )
{
+ if (utl::ConfigManager::IsFuzzing() && rDest.mxBitmap.GetSizePixel().Height() + rSource.mnY > SAL_MAX_UINT16)
+ {
+ SAL_WARN("filter.icgm", "bitmap would expand too much");
+ rDest.mbStatus = false;
+ return;
+ }
rDest.mxBitmap.Expand( 0, rSource.mnY );
rDest.mxBitmap.CopyPixel( tools::Rectangle( Point( 0, rDest.mnY ), Size( rSource.mnX, rSource.mnY ) ),
tools::Rectangle( Point( 0, 0 ), Size( rSource.mnX, rSource.mnY ) ), &rSource.mxBitmap );