summaryrefslogtreecommitdiff
path: root/emfio
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-02-25 15:06:50 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-02-26 11:33:33 +0100
commitda457f41f8f0a14014ff9f122467f3a26eb1ac20 (patch)
tree47b5ee6cfb4f220afac9c182d89f75dd0e910dbf /emfio
parent8994ae0dd27ddafed63d3edef82237158ff24d77 (diff)
ofz#31370 Divide-by-zero
Change-Id: If581d61b678616f8a80f8ad2d2dea5ecbf10d8fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111557 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'emfio')
-rw-r--r--emfio/source/reader/mtftools.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index 7ea5b7969c52..29b31438b399 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -389,7 +389,7 @@ namespace emfio
const tools::Long nMeasuredTextLength(pTempVirtualDevice->GetTextWidth(rText));
// compare expected and imported TextLengths
- if(nImportedTextLength != nMeasuredTextLength)
+ if (nImportedTextLength != nMeasuredTextLength && nMeasuredTextLength)
{
const double fFactorText(static_cast<double>(nImportedTextLength) / static_cast<double>(nMeasuredTextLength));
const double fFactorTextPercent(fabs(1.0 - fFactorText) * 100.0);