summaryrefslogtreecommitdiff
path: root/vcl/workben
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-03-06 15:39:18 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-03-06 18:30:27 +0100
commit434d852762eafe7230299ea6110096b9ac8bb98d (patch)
tree10f552ebbde49683a5c829020cd85c178e1237bf /vcl/workben
parentc207e2c7a3a49bc46488056d0d106517781c3ef4 (diff)
ofz#45276 uncaught exception
Change-Id: I5863d6474aa47f24b24a15481c8329a5e587a8d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131078 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/workben')
-rw-r--r--vcl/workben/fftester.cxx28
-rw-r--r--vcl/workben/svmfuzzer.cxx11
2 files changed, 17 insertions, 22 deletions
diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx
index 7938f0011b38..4950341462a8 100644
--- a/vcl/workben/fftester.cxx
+++ b/vcl/workben/fftester.cxx
@@ -182,15 +182,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
SvFileStream aFileStream(out, StreamMode::READ);
ret = static_cast<int>(ReadDIB(aTarget, aFileStream, true));
}
- else if (strcmp(argv[2], "svm") == 0)
- {
- GDIMetaFile aGDIMetaFile;
- SvFileStream aFileStream(out, StreamMode::READ);
- SvmReader aReader(aFileStream);
- aReader.Read(aGDIMetaFile);
- ScopedVclPtrInstance<VirtualDevice> aVDev;
- aGDIMetaFile.Play(*aVDev);
- }
else if (strcmp(argv[2], "pcd") == 0)
{
Graphic aGraphic;
@@ -263,6 +254,13 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
SvFileStream aFileStream(out, StreamMode::READ);
ret = static_cast<int>(ImportWebpGraphic(aFileStream, aGraphic));
}
+ else if (strcmp(argv[2], "sft") == 0)
+ {
+ SvFileStream aFileStream(out, StreamMode::READ);
+ std::vector<sal_uInt8> aData(aFileStream.remainingSize());
+ aFileStream.ReadBytes(aData.data(), aData.size());
+ ret = TestFontSubset(aData.data(), aData.size());
+ }
#ifndef DISABLE_DYNLOADING
else if ((strcmp(argv[2], "doc") == 0) || (strcmp(argv[2], "ww8") == 0))
{
@@ -524,14 +522,16 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
SvFileStream aFileStream(out, StreamMode::READ);
ret = static_cast<int>((*pfnImport)(aFileStream));
}
- else if (strcmp(argv[2], "sft") == 0)
+ else if (strcmp(argv[2], "svm") == 0)
{
+ static FFilterCall pfnImport(nullptr);
+ if (!pfnImport)
+ {
+ pfnImport = load(u"libvcllo.so", "TestImportSVM");
+ }
SvFileStream aFileStream(out, StreamMode::READ);
- std::vector<sal_uInt8> aData(aFileStream.remainingSize());
- aFileStream.ReadBytes(aData.data(), aData.size());
- ret = TestFontSubset(aData.data(), aData.size());
+ ret = static_cast<int>((*pfnImport)(aFileStream));
}
-
#endif
}
catch (...)
diff --git a/vcl/workben/svmfuzzer.cxx b/vcl/workben/svmfuzzer.cxx
index 06188ece3004..53757e3199c7 100644
--- a/vcl/workben/svmfuzzer.cxx
+++ b/vcl/workben/svmfuzzer.cxx
@@ -8,14 +8,13 @@
*/
#include <tools/stream.hxx>
-#include <vcl/gdimtf.hxx>
-#include <vcl/virdev.hxx>
-#include <vcl/filter/SvmReader.hxx>
#include "commonfuzzer.hxx"
#include <config_features.h>
#include <osl/detail/component-mapping.h>
+extern "C" bool TestImportSVM(SvStream &rStream);
+
extern "C" {
void * com_sun_star_i18n_LocaleDataImpl_get_implementation( void *, void * );
void * com_sun_star_i18n_BreakIterator_Unicode_get_implementation( void *, void * );
@@ -77,11 +76,7 @@ extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
- GDIMetaFile aGDIMetaFile;
- SvmReader aReader(aStream);
- aReader.Read(aGDIMetaFile);
- ScopedVclPtrInstance<VirtualDevice> aVDev;
- aGDIMetaFile.Play(*aVDev);
+ (void)TestImportSVM(aStream);
return 0;
}