drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit aa391cc2811e1efefcec02ccaaa9897252be69f2
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Nov 14 11:35:21 2025 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Wed Dec 3 15:16:55 2025 +0100

    tdf#169112 lockup when switching to notes view
    
    For reasons I dont understand we end up trying to create
    polygons with millions of points to render the wavy underline here.
    
    Just apply a fairly arbitrary exit to prevent that.
    
    regression from
      commit 79ab5c3775f8d0685585810583b84c0f4d49a1bf
      Author: Armin Le Grand (Collabora) <[email protected]>
      Date:   Fri Aug 23 20:59:55 2024 +0200
      CairoSDPR: Let VclPixelProcessor2D use RedLining decompose
    
    Change-Id: I703eeeb0bd4a9987d9d355493ffd7fa8664c2d9e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194011
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>
    (cherry picked from commit a07f2ddafcd157fb6161306e375e17c77782df53)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194096
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx 
b/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx
index 1efc7442ba73..4d520b76c30a 100644
--- a/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx
@@ -77,6 +77,9 @@ namespace drawinglayer::primitive2d
             // get pre-calculated vector and controlPoint for one wave segment
             basegfx::B2DVector aVector(aStop - aStart);
             double fLength(aVector.getLength());
+            // tdf#169112 prevent us from creating enormous polygons
+            if (fLength == 0 || fWaveLength == 0 || (fLength / fWaveLength) > 
1024)
+                return nullptr;
             aVector.normalize();
             basegfx::B2DVector aControl(basegfx::getPerpendicular(aVector));
             aVector *= fWaveLength;

Reply via email to