[Libreoffice-commits] core.git: filter/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sat Oct 5 13:18:40 UTC 2019


 filter/source/graphicfilter/idxf/dxf2mtf.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 86875a2e910bcc1a9d2c47c34ea5f71501776193
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Oct 4 16:59:36 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Oct 5 15:17:26 2019 +0200

    ofz#17448 avoid OOM
    
    Change-Id: Ie709eb0ce7c3987081b4b01fd96e7f99e7a48c27
    Reviewed-on: https://gerrit.libreoffice.org/80240
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
index 74895eb4251f..c57ad6b97924 100644
--- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx
+++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
@@ -19,6 +19,7 @@
 
 
 #include <string.h>
+#include <unotools/configmgr.hxx>
 #include <vcl/gdimtf.hxx>
 #include <vcl/metaact.hxx>
 #include <vcl/virdev.hxx>
@@ -300,6 +301,8 @@ void DXF2GDIMetaFile::DrawCircleEntity(const DXFCircleEntity & rE, const DXFTran
 
 void DXF2GDIMetaFile::DrawLine(const Point& rA, const Point& rB)
 {
+    if (utl::ConfigManager::IsFuzzing())
+        return;
     GDIMetaFile* pMetaFile = pVirDev->GetConnectMetaFile();
     assert(pMetaFile);
     //use AddAction instead of OutputDevice::DrawLine so that we can explicitly share
@@ -811,7 +814,8 @@ bool DXF2GDIMetaFile::Convert(const DXFRepresentation & rDXF, GDIMetaFile & rMTF
     }
 
     pVirDev->EnableOutput(false);
-    rMTF.Record(pVirDev);
+    if (!utl::ConfigManager::IsFuzzing()) // for fuzzing don't bother recording the drawing
+        rMTF.Record(pVirDev);
 
     aActLineColor = pVirDev->GetLineColor();
     aActFillColor = pVirDev->GetFillColor();


More information about the Libreoffice-commits mailing list