[Libreoffice-commits] core.git: vcl/source
Caolán McNamara
caolanm at redhat.com
Sat Feb 10 16:40:43 UTC 2018
vcl/source/filter/jpeg/jpegc.cxx | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit 7cc2a1e231b3882c7a5a501f65230ceca92d3b36
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Feb 9 16:23:08 2018 +0000
speed up jpg fuzzing
Change-Id: Iad65200d132f8fdd0e598ff5a4ee4943a9f7ac26
Reviewed-on: https://gerrit.libreoffice.org/49508
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
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;
More information about the Libreoffice-commits
mailing list