From 6b760dc4bbb496496982d6d7aaa3701903bc3c11 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 27 Oct 2017 09:31:20 +0100 Subject: ofz#3826 Divide-by-zero MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- basegfx/source/polygon/b2dpolygoncutandtouch.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'basegfx/source') 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++]; -- cgit