summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-02-09 16:23:08 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-02-10 17:40:22 +0100
commit7cc2a1e231b3882c7a5a501f65230ceca92d3b36 (patch)
tree83a88debbc721d8d8671ad06d8a4d0e0ee5aba12 /vcl
parentf77f7feae7dcdc3091fe954ec6389019fea13eb8 (diff)
speed up jpg fuzzing
Change-Id: Iad65200d132f8fdd0e598ff5a4ee4943a9f7ac26 Reviewed-on: https://gerrit.libreoffice.org/49508 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/filter/jpeg/jpegc.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx
index 059ec200540e..ddb5075fd817 100644
--- a/vcl/source/filter/jpeg/jpegc.cxx
+++ b/vcl/source/filter/jpeg/jpegc.cxx
@@ -35,6 +35,7 @@ extern "C" {
#include "JpegReader.hxx"
#include "JpegWriter.hxx"
#include <memory>
+#include <unotools/configmgr.hxx>
#include <vcl/bitmapaccess.hxx>
#include <vcl/graphicfilter.hxx>
@@ -203,6 +204,9 @@ void ReadJPEG(JpegStuff& rContext, JPEGReader* pJPEGReader, void* pInputStream,
long nWidth = rContext.cinfo.output_width;
long nHeight = rContext.cinfo.output_height;
+ if (nWidth > 2000 && nHeight > 2000 && utl::ConfigManager::IsFuzzing())
+ return;
+
bool bGray = (rContext.cinfo.output_components == 1);
JPEGCreateBitmapParam aCreateBitmapParam;