summaryrefslogtreecommitdiff
path: root/vcl/workben
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2021-02-15 09:57:51 +0900
committerTomaž Vajngerl <quikee@gmail.com>2021-02-17 05:53:49 +0100
commitd338dc277d7dbe381d669728e30a1c2606a4814a (patch)
tree8efb88cafbf827e38a55ab42e247b3c378ecb2fb /vcl/workben
parent509814d936461cb7690862eac8d6c88e9f412362 (diff)
Move PSD reader from filter module into VCL
Change-Id: I53b11be6e9eb0013f017b2da5745ff525ca79c54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111017 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/workben')
-rw-r--r--vcl/workben/fftester.cxx12
-rw-r--r--vcl/workben/psdfuzzer.cxx5
2 files changed, 4 insertions, 13 deletions
diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx
index c6c2754d4dc6..fe030475e3f8 100644
--- a/vcl/workben/fftester.cxx
+++ b/vcl/workben/fftester.cxx
@@ -49,6 +49,7 @@
#include <filter/RasReader.hxx>
#include <filter/PcxReader.hxx>
#include <filter/EpsReader.hxx>
+#include <filter/PsdReader.hxx>
#include <osl/file.hxx>
#include <osl/module.hxx>
#include <tools/stream.hxx>
@@ -216,18 +217,9 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
}
else if (strcmp(argv[2], "psd") == 0)
{
- static PFilterCall pfnImport(nullptr);
- if (!pfnImport)
- {
- osl::Module aLibrary;
- aLibrary.loadRelative(&thisModule, "libgielo.so");
- pfnImport = reinterpret_cast<PFilterCall>(
- aLibrary.getFunctionSymbol("ipdGraphicImport"));
- aLibrary.release();
- }
Graphic aGraphic;
SvFileStream aFileStream(out, StreamMode::READ);
- ret = static_cast<int>((*pfnImport)(aFileStream, aGraphic, nullptr));
+ ret = static_cast<int>(ImportPsdGraphic(aFileStream, aGraphic));
}
else if (strcmp(argv[2], "eps") == 0)
{
diff --git a/vcl/workben/psdfuzzer.cxx b/vcl/workben/psdfuzzer.cxx
index a1bb1823d483..652fd1cd33fb 100644
--- a/vcl/workben/psdfuzzer.cxx
+++ b/vcl/workben/psdfuzzer.cxx
@@ -10,6 +10,7 @@
#include <tools/stream.hxx>
#include <vcl/FilterConfigItem.hxx>
#include "commonfuzzer.hxx"
+#include <filter/PsdReader.hxx>
#include <config_features.h>
#include <osl/detail/component-mapping.h>
@@ -39,8 +40,6 @@ extern "C" void* lo_get_custom_widget_func(const char*)
return nullptr;
}
-extern "C" bool ipdGraphicImport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem);
-
extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)
{
TypicalFuzzerInitialize(argc, argv);
@@ -51,7 +50,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
Graphic aGraphic;
- (void)ipdGraphicImport(aStream, aGraphic, nullptr);
+ (void)ImportPsdGraphic(aStream, aGraphic);
return 0;
}