emfio/source/reader/emfreader.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit b5602d5c853ce9479b2920743667e5af1cd63037
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Apr 5 17:04:47 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Apr 5 20:37:32 2021 +0200

    ofz: skip slow path when fuzzing
    
    Change-Id: I21d600f58174319ce6386de88ab9ac0ad371688b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113612
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/emfio/source/reader/emfreader.cxx 
b/emfio/source/reader/emfreader.cxx
index 7dbfd58a09de..3c40e3a6f914 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -24,6 +24,7 @@
 #include <o3tl/safeint.hxx>
 #include <tools/stream.hxx>
 #include <memory>
+#include <unotools/configmgr.hxx>
 #include <vcl/graph.hxx>
 #include <vcl/pdfread.hxx>
 #include <rtl/bootstrap.hxx>
@@ -359,6 +360,8 @@ bool ImplReadRegion( tools::PolyPolygon& rPolyPoly, 
SvStream& rStream, sal_uInt3
     if (nLen < nSize)
         return false;
 
+    bool bIsFuzzing = utl::ConfigManager::IsFuzzing();
+
     for (sal_uInt32 i = 0; i < nCountRects; ++i)
     {
         rStream.ReadInt32(nLeft);
@@ -367,6 +370,10 @@ bool ImplReadRegion( tools::PolyPolygon& rPolyPoly, 
SvStream& rStream, sal_uInt3
         rStream.ReadInt32(nBottom);
 
         SAL_INFO("emfio", "\t\tLeft: " << nLeft << ", top: " << nTop << ", 
right: " << nRight << ", bottom: " << nBottom);
+
+        if (bIsFuzzing && i) // GetUnion is super slow, when fuzzing skip 
after first rect
+            continue;
+
         tools::PolyPolygon aPolyPolyOr1(tools::Polygon(tools::Rectangle(nLeft, 
nTop, nRight, nBottom)));
         rPolyPoly.GetUnion(aPolyPolyOr1, rPolyPoly);
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to