vcl/source/fontsubset/sft.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b667327463de24715405322e69e1933cf50d25e6
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Mar 3 09:13:38 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Mar 3 13:43:34 2022 +0100

    ofz: Integer-overflow
    
    Change-Id: Ifb3c0e4c9fec5af448bae7efaddac234854fb468
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130906
    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 e2ae8a450954..bfdc28f1d79b 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -175,8 +175,8 @@ static F16Dot16 fixedMul(F16Dot16 a, F16Dot16 b)
     int sign;
 
     sign = (a & 0x80000000) ^ (b & 0x80000000);
-    if (a < 0) a = -a;
-    if (b < 0) b = -b;
+    if (a < 0) a = o3tl::saturating_toggle_sign(a);
+    if (b < 0) b = o3tl::saturating_toggle_sign(b);
 
     a1 = a >> 16;
     b1 = a & 0xFFFF;

Reply via email to