summaryrefslogtreecommitdiff
path: root/vcl/workben
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-24 10:05:49 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-03-24 11:43:25 +0000
commit38e729223a4cdca87ef1baccfc533156c80b5dab (patch)
tree6e7047b368fa9a0271dc59a910669e3d8cbf2c79 /vcl/workben
parentd776eeab752fd313226a7570c3ed4d8e964b4406 (diff)
ofz: explicitly release fontconfig options on every iteration
fontconfigs alloc mechanism is too complicated for lsan/valgrind so force the fontconfig options to be released at the end of every iteration, they are demand loaded so will be recreated if necessary on next use Change-Id: I061117b1fb8136298593a165847f78eabe008f0f
Diffstat (limited to 'vcl/workben')
-rw-r--r--vcl/workben/commonfuzzer.hxx2
-rw-r--r--vcl/workben/fftester.cxx15
-rw-r--r--vcl/workben/pptfuzzer.cxx4
3 files changed, 16 insertions, 5 deletions
diff --git a/vcl/workben/commonfuzzer.hxx b/vcl/workben/commonfuzzer.hxx
index f88d835cf59d..59c0ae265f53 100644
--- a/vcl/workben/commonfuzzer.hxx
+++ b/vcl/workben/commonfuzzer.hxx
@@ -24,7 +24,9 @@
#include <vcl/wmf.hxx>
#include <unistd.h>
#include <stdlib.h>
+#include "headless/svpgdi.hxx"
#include "unx/fontmanager.hxx"
+#include "unx/glyphcache.hxx"
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx
index 3611a9dd8275..d6d74f7e48aa 100644
--- a/vcl/workben/fftester.cxx
+++ b/vcl/workben/fftester.cxx
@@ -52,6 +52,8 @@
#include <osl/file.hxx>
#include <unistd.h>
#include <signal.h>
+#include "headless/svpgdi.hxx"
+#include "unx/glyphcache.hxx"
#include <../source/filter/igif/gifread.hxx>
#include <../source/filter/ixbm/xbmread.hxx>
@@ -88,6 +90,12 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
return -1;
}
+ setenv("SAL_USE_VCLPLUGIN", "svp", 1);
+ setenv("JPEGMEM", "768M", 1);
+ setenv("SAL_WMF_COMPLEXCLIP_VIA_REGION", "1", 1);
+ setenv("SAL_DISABLE_PRINTERLIST", "1", 1);
+ setenv("SAL_NO_FONT_LOOKUP", "1", 1);
+
OUString in(argv[1], strlen(argv[1]), RTL_TEXTENCODING_UTF8);
OUString out;
osl::File::getFileURLFromSystemPath(in, out);
@@ -102,11 +110,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
utl::ConfigManager::EnableAvoidConfig();
InitVCL();
- setenv("JPEGMEM", "768M", 1);
- setenv("SAL_WMF_COMPLEXCLIP_VIA_REGION", "1", 1);
- setenv("SAL_DISABLE_PRINTERLIST", "1", 1);
- setenv("SAL_NO_FONT_LOOKUP", "1", 1);
-
try_again:
{
@@ -444,6 +447,8 @@ try_again:
}
/* If AFL_PERSISTENT not set or PERSIST_MAX exceeded, exit normally. */
+
+ SvpSalGraphics::getPlatformGlyphCache().ClearFontOptions();
}
catch (...)
{
diff --git a/vcl/workben/pptfuzzer.cxx b/vcl/workben/pptfuzzer.cxx
index 45c1571171f0..6b22bba50bd8 100644
--- a/vcl/workben/pptfuzzer.cxx
+++ b/vcl/workben/pptfuzzer.cxx
@@ -32,6 +32,10 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
(void)TestImportPPT(aStream);
+ //fontconfigs alloc mechanism is too complicated for lsan/valgrind so
+ //force the fontconfig options to be released now, they are demand loaded
+ //so will be recreated if necessary
+ SvpSalGraphics::getPlatformGlyphCache().ClearFontOptions();
return 0;
}