diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2021-02-14 23:20:28 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-02-17 04:02:13 +0100 |
commit | 1093c21ed9736368ecfb8f5c7935db31256671f0 (patch) | |
tree | fe315c5464ee54d79f8c8b5253a62337832f2313 /vcl/workben | |
parent | e916e8c1816a17408cba52787035ffd9fbae5789 (diff) |
Move RAS and PCX reader from filter module into VCL
Change-Id: Id846abf257b598489a59ebf9b62b19840a950322
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111015
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/workben')
-rw-r--r-- | vcl/workben/fftester.cxx | 24 | ||||
-rw-r--r-- | vcl/workben/pcxfuzzer.cxx | 5 | ||||
-rw-r--r-- | vcl/workben/rasfuzzer.cxx | 5 |
3 files changed, 8 insertions, 26 deletions
diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx index a3f5d1d3d4f7..893565e457d3 100644 --- a/vcl/workben/fftester.cxx +++ b/vcl/workben/fftester.cxx @@ -46,6 +46,8 @@ #include <filter/TgaReader.hxx> #include <filter/PictReader.hxx> #include <filter/MetReader.hxx> +#include <filter/RasReader.hxx> +#include <filter/PcxReader.hxx> #include <osl/file.hxx> #include <osl/module.hxx> #include <tools/stream.hxx> @@ -249,33 +251,15 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) } else if (strcmp(argv[2], "pcx") == 0) { - static PFilterCall pfnImport(nullptr); - if (!pfnImport) - { - osl::Module aLibrary; - aLibrary.loadRelative(&thisModule, "libgielo.so"); - pfnImport = reinterpret_cast<PFilterCall>( - aLibrary.getFunctionSymbol("ipxGraphicImport")); - aLibrary.release(); - } Graphic aGraphic; SvFileStream aFileStream(out, StreamMode::READ); - ret = static_cast<int>((*pfnImport)(aFileStream, aGraphic, nullptr)); + ret = static_cast<int>(ImportPcxGraphic(aFileStream, aGraphic)); } else if (strcmp(argv[2], "ras") == 0) { - static PFilterCall pfnImport(nullptr); - if (!pfnImport) - { - osl::Module aLibrary; - aLibrary.loadRelative(&thisModule, "libgielo.so"); - pfnImport = reinterpret_cast<PFilterCall>( - aLibrary.getFunctionSymbol("iraGraphicImport")); - aLibrary.release(); - } Graphic aGraphic; SvFileStream aFileStream(out, StreamMode::READ); - ret = static_cast<int>((*pfnImport)(aFileStream, aGraphic, nullptr)); + ret = static_cast<int>(ImportRasGraphic(aFileStream, aGraphic)); } else if (strcmp(argv[2], "tga") == 0) { diff --git a/vcl/workben/pcxfuzzer.cxx b/vcl/workben/pcxfuzzer.cxx index e2b72fb7e765..2785cf4c4eec 100644 --- a/vcl/workben/pcxfuzzer.cxx +++ b/vcl/workben/pcxfuzzer.cxx @@ -10,6 +10,7 @@ #include <tools/stream.hxx> #include <vcl/FilterConfigItem.hxx> #include "commonfuzzer.hxx" +#include <filter/PcxReader.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 ipxGraphicImport(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)ipxGraphicImport(aStream, aGraphic, nullptr); + (void)ImportPcxGraphic(aStream, aGraphic); return 0; } diff --git a/vcl/workben/rasfuzzer.cxx b/vcl/workben/rasfuzzer.cxx index 734180b5998b..84678eace5be 100644 --- a/vcl/workben/rasfuzzer.cxx +++ b/vcl/workben/rasfuzzer.cxx @@ -10,6 +10,7 @@ #include <tools/stream.hxx> #include <vcl/FilterConfigItem.hxx> #include "commonfuzzer.hxx" +#include <filter/RasReader.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 iraGraphicImport(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)iraGraphicImport(aStream, aGraphic, nullptr); + (void)ImportRasGraphic(aStream, aGraphic); return 0; } |