diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-04-08 20:16:35 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-04-09 10:06:47 +0200 |
commit | ce9f23c6196b17985d14e441aa93175b31650f34 (patch) | |
tree | 5ea53bd2176977b670be8d4e7b223025f2bf02ff /tools/source/generic/fract.cxx | |
parent | aed1937e7efdf9a6d8c831edef73ec822832ea4e (diff) |
ofz#33038 Floating-point-exception
Change-Id: Ibe4a6667f5a14b5d94f2dbb92ad611ecba4984f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113821
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'tools/source/generic/fract.cxx')
-rw-r--r-- | tools/source/generic/fract.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/source/generic/fract.cxx b/tools/source/generic/fract.cxx index 648c91b20550..d4c4fe11c319 100644 --- a/tools/source/generic/fract.cxx +++ b/tools/source/generic/fract.cxx @@ -62,7 +62,8 @@ 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()) + if ((nDen == -1 && nNum == std::numeric_limits<sal_Int32>::min()) || + (nNum == -1 && nDen == std::numeric_limits<sal_Int32>::min())) { mbValid = false; SAL_WARN("tools.fraction", "'Fraction(" << nNum << "," << nDen << ")' invalid fraction created"); |