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

New commits:
commit a07f2ddafcd157fb6161306e375e17c77782df53
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Nov 14 11:35:21 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Fri Nov 14 13:57:05 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]>

diff --git a/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx 
b/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx
index 3687fc09e187..0de23e3e0e4f 100644
--- a/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx
@@ -76,6 +76,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