vcl/source/fontsubset/sft.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit 5da1d655bfb851d8d07c78b08e08d975549e95d3 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Mar 8 10:30:09 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Mar 8 20:55:34 2022 +0100 ofz#45357 Floating-point-exception Change-Id: I2970c2b09d19f43cc4f98a89d2b99eb4475c3065 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131178 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index fedf61d3443b..f650703090d2 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -204,8 +204,11 @@ static F16Dot16 fixedDiv(F16Dot16 a, F16Dot16 b) b >>= 1; } - F16Dot16 res = (f << 16) + (r << 16) / b; - + F16Dot16 res; + if (b == 0) + res = 0x7FFFFFFF; + else + res = (f << 16) + (r << 16) / b; return sign ? -res : res; }