summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-10-25 14:40:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-10-25 21:33:19 +0200
commitdb4d4bac22d73e93729261739cda06382883b8f8 (patch)
treeeb1d8860acdd78f445f60475f3b4f39a0475b9be /svx
parent933b66c1227bb9c0e6b80a16e45d9153cea9e8a8 (diff)
ofz#3801 Divide-by-zero
Change-Id: Ibb2f3e5508899541bc201240a7e9d5f26c750fa5 Reviewed-on: https://gerrit.libreoffice.org/43843 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index dc5693d0ff71..9d4faa31e5aa 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -691,6 +691,11 @@ void FitTextOutlinesToShapeOutlines( const tools::PolyPolygon& aOutlines2d, FWDa
double fAngle = atan2( -fvx, -fvy );
double fL = hypot( fvx, fvy );
+ if (fL == 0.0)
+ {
+ SAL_WARN("svx", "FitTextOutlinesToShapeOutlines div-by-zero, abandon fit");
+ break;
+ }
fvx = fvx / fL;
fvy = fvy / fL;
fL = aTextAreaIter->aBoundRect.GetHeight() / 2.0 + aTextAreaIter->aBoundRect.Top() - aParagraphIter->aBoundRect.Center().Y();