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

Caolán McNamara caolanm at redhat.com
Fri Oct 27 10:16:15 UTC 2017


 basegfx/source/polygon/b2dpolygoncutandtouch.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6b760dc4bbb496496982d6d7aaa3701903bc3c11
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 27 09:31:20 2017 +0100

    ofz#3826 Divide-by-zero
    
    with fLeftStart == 1.0 (is allowed, see comment at mfCut) the whole
    BezierSegment is needed and does not need to be cut at all so best would be to
    add it to 'while' loop, after that the 'rest' will be added anyways so, add
    'fLeftStart < 1.0' or 'fLeftStart != 1.0' (since limited to [0.0 .. 1.0]) to
    the while in line 120 should do it
    
    Change-Id: Ida87e06247d169482df26e665985753e634e149e
    Reviewed-on: https://gerrit.libreoffice.org/43935
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
index 843b9c64e7ae..3d64dee7838b 100644
--- a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
+++ b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
@@ -117,7 +117,7 @@ namespace basegfx
                             double fLeftStart(0.0);
 
                             // now add all points targeted to be at this index
-                            while(nNewInd < nTempPointCount && rTempPoints[nNewInd].getIndex() == a)
+                            while (nNewInd < nTempPointCount && rTempPoints[nNewInd].getIndex() == a && fLeftStart < 1.0)
                             {
                                 const temporaryPoint& rTempPoint = rTempPoints[nNewInd++];
 


More information about the Libreoffice-commits mailing list