[Libreoffice-commits] core.git: filter/CppunitTest_filter_tga_test.mk filter/Library_gie.mk filter/Module_filter.mk filter/qa filter/source include/vcl solenv/clang-format vcl/CppunitTest_vcl_filters_test.mk vcl/inc vcl/Library_vcl.mk vcl/qa vcl/source vcl/workben

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Wed Feb 17 01:44:15 UTC 2021


 filter/CppunitTest_filter_tga_test.mk                                |   38 ----------
 filter/Library_gie.mk                                                |    1 
 filter/Module_filter.mk                                              |    1 
 filter/source/config/fragments/internalgraphicfilters/tga_Import.xcu |   21 ++---
 include/vcl/graphicfilter.hxx                                        |    2 
 solenv/clang-format/excludelist                                      |    4 -
 vcl/CppunitTest_vcl_filters_test.mk                                  |    1 
 vcl/Library_vcl.mk                                                   |    1 
 vcl/inc/filter/TgaReader.hxx                                         |   26 ++++++
 vcl/qa/cppunit/graphicfilter/filters-tga-test.cxx                    |   17 +---
 vcl/source/filter/FilterConfigCache.cxx                              |    7 +
 vcl/source/filter/graphicfilter.cxx                                  |   20 +++--
 vcl/source/filter/itga/itga.cxx                                      |    4 -
 vcl/workben/fftester.cxx                                             |   12 ---
 vcl/workben/tgafuzzer.cxx                                            |    5 -
 15 files changed, 72 insertions(+), 88 deletions(-)

New commits:
commit 246af1d40ec515fe31ef2ac3375401c3fe284157
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Feb 14 21:29:45 2021 +0900
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Wed Feb 17 02:43:18 2021 +0100

    Move TGA reader from filter module into VCL
    
    Change-Id: I0fea5d6e75c6bfd05ea91ed7b92aaacfcc5ec177
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111010
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/filter/CppunitTest_filter_tga_test.mk b/filter/CppunitTest_filter_tga_test.mk
deleted file mode 100644
index 33ae034c0e30..000000000000
--- a/filter/CppunitTest_filter_tga_test.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_CppunitTest_CppunitTest,filter_tga_test))
-
-$(eval $(call gb_CppunitTest_use_external,filter_tga_test,boost_headers))
-
-$(eval $(call gb_CppunitTest_add_exception_objects,filter_tga_test, \
-    filter/qa/cppunit/filters-tga-test \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,filter_tga_test, \
-    gie \
-	sal \
-	test \
-	tl \
-	unotest \
-	vcl \
-))
-
-$(eval $(call gb_CppunitTest_use_sdk_api,filter_tga_test))
-
-$(eval $(call gb_CppunitTest_use_ure,filter_tga_test))
-$(eval $(call gb_CppunitTest_use_vcl,filter_tga_test))
-
-$(eval $(call gb_CppunitTest_use_components,filter_tga_test,\
-    configmgr/source/configmgr \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,filter_tga_test))
-
-# vim: set noet sw=4 ts=4:
diff --git a/filter/Library_gie.mk b/filter/Library_gie.mk
index 8c0cbd46b9b9..be60d68e3de7 100644
--- a/filter/Library_gie.mk
+++ b/filter/Library_gie.mk
@@ -56,7 +56,6 @@ $(eval $(call gb_Library_add_exception_objects,gie,\
     filter/source/graphicfilter/ipict/shape \
     filter/source/graphicfilter/ipcx/ipcx \
     filter/source/graphicfilter/iras/iras \
-    filter/source/graphicfilter/itga/itga \
     filter/source/graphicfilter/ieps/ieps \
     filter/source/graphicfilter/ipsd/ipsd \
     filter/source/graphicfilter/ipbm/ipbm \
diff --git a/filter/Module_filter.mk b/filter/Module_filter.mk
index 898ac710db8a..a998c65b60ab 100644
--- a/filter/Module_filter.mk
+++ b/filter/Module_filter.mk
@@ -64,7 +64,6 @@ $(eval $(call gb_Module_add_check_targets,filter,\
     CppunitTest_filter_ppm_test \
     CppunitTest_filter_psd_test \
     CppunitTest_filter_ras_test \
-    CppunitTest_filter_tga_test \
     CppunitTest_filter_svg \
 ))
 endif
diff --git a/filter/source/config/fragments/internalgraphicfilters/tga_Import.xcu b/filter/source/config/fragments/internalgraphicfilters/tga_Import.xcu
index 7ea4d49ec624..922cdefbf1ab 100644
--- a/filter/source/config/fragments/internalgraphicfilters/tga_Import.xcu
+++ b/filter/source/config/fragments/internalgraphicfilters/tga_Import.xcu
@@ -15,13 +15,14 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 -->
-    <node oor:name="tga_Import" oor:op="replace"  >
-        <prop oor:name="Type"><value>tga_Truevision_TARGA</value></prop>
-        <prop oor:name="FormatName"><value>itg</value></prop>
-        <prop oor:name="RealFilterName"><value>TGA - Truevision TARGA</value></prop>
-        <prop oor:name="UIComponent"/>
-        <prop oor:name="UIName">
-            <value xml:lang="en-US">TGA - Truevision Targa</value>
-        </prop>
-        <prop oor:name="Flags"><value>IMPORT</value></prop>
-    </node>
+
+<node oor:name="tga_Import" oor:op="replace"  >
+    <prop oor:name="Type"><value>tga_Truevision_TARGA</value></prop>
+    <prop oor:name="FormatName"><value>SVTGA</value></prop>
+    <prop oor:name="RealFilterName"><value>TGA - Truevision TARGA</value></prop>
+    <prop oor:name="UIComponent"/>
+    <prop oor:name="UIName">
+        <value xml:lang="en-US">TGA - Truevision Targa</value>
+    </prop>
+    <prop oor:name="Flags"><value>IMPORT</value></prop>
+</node>
diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx
index 59c7fe9896e9..4c0f2b4a339d 100644
--- a/include/vcl/graphicfilter.hxx
+++ b/include/vcl/graphicfilter.hxx
@@ -79,6 +79,7 @@ namespace o3tl
 #define IMP_SVG                 "SVISVG"
 #define IMP_PDF                 "SVIPDF"
 #define IMP_TIFF                "SVTIFF"
+#define IMP_TGA                 "SVTGA"
 #define EXP_BMP                 "SVBMP"
 #define EXP_SVMETAFILE          "SVMETAFILE"
 #define EXP_WMF                 "SVWMF"
@@ -360,6 +361,7 @@ public:
     static ErrCode readPDF(SvStream & rStream, Graphic & rGraphic, GfxLinkType & rLinkType);
     static ErrCode readTIFF(SvStream & rStream, Graphic & rGraphic, GfxLinkType & rLinkType);
     static ErrCode readWithTypeSerializer(SvStream & rStream, Graphic & rGraphic, GfxLinkType & rLinkType, OUString aFilterName);
+    static ErrCode readTGA(SvStream & rStream, Graphic & rGraphic);
 
 private:
     OUString        aFilterPath;
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index c3adfdc68de2..b8d95a0fad42 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -3906,7 +3906,6 @@ filter/qa/cppunit/filters-pict-test.cxx
 filter/qa/cppunit/filters-ppm-test.cxx
 filter/qa/cppunit/filters-psd-test.cxx
 filter/qa/cppunit/filters-ras-test.cxx
-filter/qa/cppunit/filters-tga-test.cxx
 filter/qa/cppunit/msfilter-test.cxx
 filter/qa/cppunit/priority-test.cxx
 filter/qa/cppunit/xslt-test.cxx
@@ -3983,7 +3982,6 @@ filter/source/graphicfilter/ipict/shape.cxx
 filter/source/graphicfilter/ipict/shape.hxx
 filter/source/graphicfilter/ipsd/ipsd.cxx
 filter/source/graphicfilter/iras/iras.cxx
-filter/source/graphicfilter/itga/itga.cxx
 filter/source/msfilter/countryid.cxx
 filter/source/msfilter/dffpropset.cxx
 filter/source/msfilter/escherex.cxx
@@ -14828,6 +14826,7 @@ vcl/qa/cppunit/errorhandler.cxx
 vcl/qa/cppunit/font.cxx
 vcl/qa/cppunit/fontmetric.cxx
 vcl/qa/cppunit/graphicfilter/filters-test.cxx
+vcl/qa/cppunit/graphicfilter/filters-tga-test.cxx
 vcl/qa/cppunit/lifecycle.cxx
 vcl/qa/cppunit/svm/svmtest.cxx
 vcl/qa/cppunit/timer.cxx
@@ -14939,6 +14938,7 @@ vcl/source/filter/igif/gifread.cxx
 vcl/source/filter/ixbm/xbmread.cxx
 vcl/source/filter/ixpm/rgbtable.hxx
 vcl/source/filter/ixpm/xpmread.cxx
+vcl/source/filter/itga/itga.cxx
 vcl/source/filter/itiff/ccidecom.cxx
 vcl/source/filter/itiff/ccidecom.hxx
 vcl/source/filter/itiff/itiff.cxx
diff --git a/vcl/CppunitTest_vcl_filters_test.mk b/vcl/CppunitTest_vcl_filters_test.mk
index 70667a04417b..bd4131f3983e 100644
--- a/vcl/CppunitTest_vcl_filters_test.mk
+++ b/vcl/CppunitTest_vcl_filters_test.mk
@@ -12,6 +12,7 @@ $(eval $(call gb_CppunitTest_CppunitTest,vcl_filters_test))
 $(eval $(call gb_CppunitTest_add_exception_objects,vcl_filters_test, \
     vcl/qa/cppunit/graphicfilter/filters-test \
     vcl/qa/cppunit/graphicfilter/filters-tiff-test \
+    vcl/qa/cppunit/graphicfilter/filters-tga-test \
 ))
 
 $(eval $(call gb_CppunitTest_set_include,vcl_filters_test,\
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index a27af8f6d031..a19125934bc0 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -437,6 +437,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/filter/GraphicFormatDetector \
     vcl/source/filter/igif/decode \
     vcl/source/filter/igif/gifread \
+    vcl/source/filter/itga/itga \
     vcl/source/filter/ipdf/pdfread \
     vcl/source/filter/ipdf/pdfdocument \
     vcl/source/filter/itiff/ccidecom \
diff --git a/vcl/inc/filter/TgaReader.hxx b/vcl/inc/filter/TgaReader.hxx
new file mode 100644
index 000000000000..34f75648717c
--- /dev/null
+++ b/vcl/inc/filter/TgaReader.hxx
@@ -0,0 +1,26 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <vcl/graph.hxx>
+
+VCL_DLLPUBLIC bool ImportTgaGraphic(SvStream& rStream, Graphic& rGraphic);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/qa/cppunit/data/tga/fail/.gitignore b/vcl/qa/cppunit/graphicfilter/data/tga/fail/.gitignore
similarity index 100%
rename from filter/qa/cppunit/data/tga/fail/.gitignore
rename to vcl/qa/cppunit/graphicfilter/data/tga/fail/.gitignore
diff --git a/filter/qa/cppunit/data/tga/fail/CVE-2012-3755-1.tga b/vcl/qa/cppunit/graphicfilter/data/tga/fail/CVE-2012-3755-1.tga
similarity index 100%
rename from filter/qa/cppunit/data/tga/fail/CVE-2012-3755-1.tga
rename to vcl/qa/cppunit/graphicfilter/data/tga/fail/CVE-2012-3755-1.tga
diff --git a/filter/qa/cppunit/data/tga/indeterminate/.gitignore b/vcl/qa/cppunit/graphicfilter/data/tga/indeterminate/.gitignore
similarity index 100%
rename from filter/qa/cppunit/data/tga/indeterminate/.gitignore
rename to vcl/qa/cppunit/graphicfilter/data/tga/indeterminate/.gitignore
diff --git a/filter/qa/cppunit/data/tga/pass/.gitignore b/vcl/qa/cppunit/graphicfilter/data/tga/pass/.gitignore
similarity index 100%
rename from filter/qa/cppunit/data/tga/pass/.gitignore
rename to vcl/qa/cppunit/graphicfilter/data/tga/pass/.gitignore
diff --git a/filter/qa/cppunit/data/tga/pass/fdo14924-5.tga b/vcl/qa/cppunit/graphicfilter/data/tga/pass/fdo14924-5.tga
similarity index 100%
rename from filter/qa/cppunit/data/tga/pass/fdo14924-5.tga
rename to vcl/qa/cppunit/graphicfilter/data/tga/pass/fdo14924-5.tga
diff --git a/filter/qa/cppunit/data/tga/pass/fdo14924-6.tga b/vcl/qa/cppunit/graphicfilter/data/tga/pass/fdo14924-6.tga
similarity index 100%
rename from filter/qa/cppunit/data/tga/pass/fdo14924-6.tga
rename to vcl/qa/cppunit/graphicfilter/data/tga/pass/fdo14924-6.tga
diff --git a/filter/qa/cppunit/filters-tga-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-tga-test.cxx
similarity index 81%
rename from filter/qa/cppunit/filters-tga-test.cxx
rename to vcl/qa/cppunit/graphicfilter/filters-tga-test.cxx
index c87216803120..d0611aa56ce9 100644
--- a/filter/qa/cppunit/filters-tga-test.cxx
+++ b/vcl/qa/cppunit/graphicfilter/filters-tga-test.cxx
@@ -12,13 +12,7 @@
 #include <vcl/FilterConfigItem.hxx>
 #include <tools/stream.hxx>
 #include <vcl/graph.hxx>
-
-extern "C"
-{
-    SAL_DLLPUBLIC_EXPORT bool SAL_CALL
-        itgGraphicImport(SvStream & rStream, Graphic & rGraphic,
-        FilterConfigItem*);
-}
+#include <filter/TgaReader.hxx>
 
 using namespace ::com::sun::star;
 
@@ -51,17 +45,16 @@ bool TgaFilterTest::load(const OUString &,
 {
     SvFileStream aFileStream(rURL, StreamMode::READ);
     Graphic aGraphic;
-    return itgGraphicImport(aFileStream, aGraphic, nullptr);
+    return ImportTgaGraphic(aFileStream, aGraphic);
 }
 
 void TgaFilterTest::testCVEs()
 {
-    testDir(OUString(),
-        m_directories.getURLFromSrc(u"/filter/qa/cppunit/data/tga/"));
+#ifndef DISABLE_CVE_TESTS
+    testDir(OUString(), m_directories.getURLFromSrc(u"/vcl/qa/cppunit/graphicfilter/data/tga/"));
+#endif
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(TgaFilterTest);
 
-CPPUNIT_PLUGIN_IMPLEMENT();
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/filter/FilterConfigCache.cxx b/vcl/source/filter/FilterConfigCache.cxx
index 020d77c3d298..05ba4eeefe8e 100644
--- a/vcl/source/filter/FilterConfigCache.cxx
+++ b/vcl/source/filter/FilterConfigCache.cxx
@@ -42,7 +42,8 @@ using namespace ::com::sun::star::configuration ;
 const char* FilterConfigCache::FilterConfigCacheEntry::InternalPixelFilterNameList[] =
 {
     IMP_BMP, IMP_GIF, IMP_PNG, IMP_JPEG, IMP_XBM, IMP_XPM,
-    EXP_BMP, EXP_JPEG, EXP_PNG, IMP_MOV, IMP_TIFF, EXP_TIFF, nullptr
+    EXP_BMP, EXP_JPEG, EXP_PNG, IMP_MOV, IMP_TIFF, EXP_TIFF,
+    IMP_TGA, nullptr
 };
 
 const char* FilterConfigCache::FilterConfigCacheEntry::InternalVectorFilterNameList[] =
@@ -54,7 +55,7 @@ const char* FilterConfigCache::FilterConfigCacheEntry::InternalVectorFilterNameL
 const char* FilterConfigCache::FilterConfigCacheEntry::ExternalPixelFilterNameList[] =
 {
     "egi", "icd", "ipd", "ipx", "ipb", "epb", "epg",
-    "epp", "ira", "era", "itg", "exp", nullptr
+    "epp", "ira", "era", "exp", nullptr
 };
 
 void FilterConfigCache::FilterConfigCacheEntry::CreateFilterName( const OUString& rUserDataEntry )
@@ -243,7 +244,7 @@ const char* FilterConfigCache::InternalFilterListForSvxLight[] =
     "ras","2","era",
     "svm","1","SVMETAFILE",
     "svm","2","SVMETAFILE",
-    "tga","1","itg",
+    "tga","1","SVTGA",
     "tif","1","SVTIFF",
     "tif","2","SVTIFF",
     "emf","1","SVEMF",
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 3a2e38ec5b11..3546539b8787 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -49,6 +49,7 @@
 #include "ixpm/xpmread.hxx"
 #include <filter/TiffReader.hxx>
 #include <filter/TiffWriter.hxx>
+#include <filter/TgaReader.hxx>
 #include <osl/module.hxx>
 #include <com/sun/star/uno/Reference.h>
 #include <com/sun/star/awt/Size.hpp>
@@ -648,7 +649,6 @@ extern "C" bool ipsGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterCo
 extern "C" bool iptGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem );
 extern "C" bool ipxGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem );
 extern "C" bool iraGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem );
-extern "C" bool itgGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem );
 
 #endif
 
@@ -675,8 +675,6 @@ PFilterCall ImpFilterLibCacheEntry::GetImportFunction()
             mpfnImport = reinterpret_cast<PFilterCall>(maLibrary.getFunctionSymbol("ipxGraphicImport"));
         else if (maFormatName == "ira")
             mpfnImport = reinterpret_cast<PFilterCall>(maLibrary.getFunctionSymbol("iraGraphicImport"));
-        else if (maFormatName == "itg")
-            mpfnImport = reinterpret_cast<PFilterCall>(maLibrary.getFunctionSymbol("itgGraphicImport"));
  #else
         if (maFormatName ==  "icd")
             mpfnImport = icdGraphicImport;
@@ -696,8 +694,6 @@ PFilterCall ImpFilterLibCacheEntry::GetImportFunction()
             mpfnImport = ipxGraphicImport;
         else if (maFormatName ==  "ira")
             mpfnImport = iraGraphicImport;
-        else if (maFormatName ==  "itg")
-            mpfnImport = itgGraphicImport;
  #endif
     }
 
@@ -1430,7 +1426,7 @@ void GraphicFilter::preload()
     sal_Int32 nTokenCount = comphelper::string::getTokenCount(aFilterPath, ';');
     ImpFilterLibCache& rCache = Cache::get();
     static const std::initializer_list<std::u16string_view> aFilterNames = {
-        u"icd", u"idx", u"ime", u"ipb", u"ipd", u"ips", u"ipt", u"ipx", u"ira", u"itg",
+        u"icd", u"idx", u"ime", u"ipb", u"ipd", u"ips", u"ipt", u"ipx", u"ira",
     };
 
     // Load library for each filter.
@@ -1714,6 +1710,14 @@ ErrCode GraphicFilter::readWithTypeSerializer(SvStream & rStream, Graphic & rGra
     return aReturnCode;
 }
 
+ErrCode GraphicFilter::readTGA(SvStream & rStream, Graphic & rGraphic)
+{
+    if (ImportTgaGraphic(rStream, rGraphic))
+        return ERRCODE_NONE;
+    else
+        return ERRCODE_GRFILTER_FILTERERROR;
+}
+
 ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath, SvStream& rIStream,
                                      sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, GraphicFilterImportFlags nImportFlags,
                                      const css::uno::Sequence< css::beans::PropertyValue >* /*pFilterData*/,
@@ -1827,6 +1831,10 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath,
         {
             nStatus = readTIFF(rIStream, rGraphic, eLinkType);
         }
+        else if (aFilterName.equalsIgnoreAsciiCase(IMP_TGA) )
+        {
+            nStatus = readTGA(rIStream, rGraphic);
+        }
         else
             nStatus = ERRCODE_GRFILTER_FILTERERROR;
     }
diff --git a/filter/source/graphicfilter/itga/itga.cxx b/vcl/source/filter/itga/itga.cxx
similarity index 99%
rename from filter/source/graphicfilter/itga/itga.cxx
rename to vcl/source/filter/itga/itga.cxx
index 8c8af9d52cd8..e668839ebab7 100644
--- a/filter/source/graphicfilter/itga/itga.cxx
+++ b/vcl/source/filter/itga/itga.cxx
@@ -22,6 +22,7 @@
 #include <vcl/BitmapTools.hxx>
 #include <tools/stream.hxx>
 #include <memory>
+#include <filter/TgaReader.hxx>
 
 class FilterConfigItem;
 
@@ -780,8 +781,7 @@ bool TGAReader::ImplReadPalette()
 
 //================== GraphicImport - the exported function ================
 
-extern "C" SAL_DLLPUBLIC_EXPORT bool
-itgGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* )
+bool ImportTgaGraphic(SvStream & rStream, Graphic & rGraphic)
 {
     TGAReader aTGAReader(rStream);
 
diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx
index 42c2447564e7..f2e0d51b0c74 100644
--- a/vcl/workben/fftester.cxx
+++ b/vcl/workben/fftester.cxx
@@ -43,6 +43,7 @@
 #include <vcl/wrkwin.hxx>
 #include <fltcall.hxx>
 #include <filter/TiffReader.hxx>
+#include <filter/TgaReader.hxx>
 #include <osl/file.hxx>
 #include <osl/module.hxx>
 #include <tools/stream.hxx>
@@ -294,18 +295,9 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
         }
         else if (strcmp(argv[2], "tga") == 0)
         {
-            static PFilterCall pfnImport(nullptr);
-            if (!pfnImport)
-            {
-                osl::Module aLibrary;
-                aLibrary.loadRelative(&thisModule, "libgielo.so");
-                pfnImport = reinterpret_cast<PFilterCall>(
-                    aLibrary.getFunctionSymbol("itgGraphicImport"));
-                aLibrary.release();
-            }
             Graphic aGraphic;
             SvFileStream aFileStream(out, StreamMode::READ);
-            ret = static_cast<int>((*pfnImport)(aFileStream, aGraphic, nullptr));
+            ret = static_cast<int>(ImportTgaGraphic(aFileStream, aGraphic));
         }
         else if (strcmp(argv[2], "tif") == 0)
         {
diff --git a/vcl/workben/tgafuzzer.cxx b/vcl/workben/tgafuzzer.cxx
index 47ba63b71da7..32b7fcb3d578 100644
--- a/vcl/workben/tgafuzzer.cxx
+++ b/vcl/workben/tgafuzzer.cxx
@@ -10,6 +10,7 @@
 #include <tools/stream.hxx>
 #include <vcl/FilterConfigItem.hxx>
 #include "commonfuzzer.hxx"
+#include <filter/TgaReader.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 itgGraphicImport(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)itgGraphicImport(aStream, aGraphic, nullptr);
+    (void)ImportTgaGraphic(aStream, aGraphic);
     return 0;
 }
 


More information about the Libreoffice-commits mailing list