summaryrefslogtreecommitdiff
path: root/filter/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-10-31 08:57:01 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-10-31 16:34:23 +0100
commitf550ed4db708bd892b75bead4731bd67d30a8949 (patch)
treea8461ec02fb478f7e1e887479d5be9c96e513661 /filter/source
parent6b61c3f7fdcdd8721bf51c39fdcce7e9851a6686 (diff)
ofz#3932 Divide-by-zero
Change-Id: I912e082826f8433254edafe146bf5e746fdf914a Reviewed-on: https://gerrit.libreoffice.org/44100 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'filter/source')
-rw-r--r--filter/source/graphicfilter/icgm/actimpr.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx
index a5cff6dab0d6..155ad22208d9 100644
--- a/filter/source/graphicfilter/icgm/actimpr.cxx
+++ b/filter/source/graphicfilter/icgm/actimpr.cxx
@@ -755,7 +755,8 @@ void CGMImpressOutAct::DrawText( awt::Point const & rTextPos, awt::Size& rTextSi
maXShape->setSize( awt::Size( nWidth, nHeight ) );
double nX = mpCGM->pElement->nCharacterOrientation[ 2 ];
double nY = mpCGM->pElement->nCharacterOrientation[ 3 ];
- double nOrientation = acos( nX / sqrt( nX * nX + nY * nY ) ) * 57.29577951308;
+ double fSqrt = sqrt(nX * nX + nY * nY);
+ double nOrientation = fSqrt != 0.0 ? (acos(nX / fSqrt) * 57.29577951308) : 0.0;
if ( nY < 0 )
nOrientation = 360 - nOrientation;