summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-04-04 20:34:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-04-05 12:18:31 +0200
commitb4613a30fed86aa8eed45e1ecee13947a33ea81c (patch)
tree2a5689195fdbbb2124ddc53c58703fca7887aaf8 /tools
parent21d69f8fd4261bec73e209fbf17b11348c70946f (diff)
ofz#32885 regard as invalid fractions that will FPE boost::integer::gcd
Change-Id: I59befe0cd21be54d1c94bb28e3d9c01f1483c104 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113574 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/generic/fract.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/source/generic/fract.cxx b/tools/source/generic/fract.cxx
index b525d1de9896..a76ce01e1f81 100644
--- a/tools/source/generic/fract.cxx
+++ b/tools/source/generic/fract.cxx
@@ -64,6 +64,12 @@ Fraction::Fraction( sal_Int64 nNum, sal_Int64 nDen ) : mnNumerator(nNum), mnDeno
SAL_WARN( "tools.fraction", "'Fraction(" << nNum << ",0)' invalid fraction created" );
return;
}
+ if (nDen == -1 && nNum == std::numeric_limits<sal_Int32>::min())
+ {
+ mbValid = false;
+ SAL_WARN("tools.fraction", "'Fraction(" << nNum << "," << nDen << ")' invalid fraction created");
+ return;
+ }
}
/**