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

New commits:
commit 0969f23a2fde82863ece428fbfe81c62a8d8fff8
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Feb 28 13:07:12 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Feb 28 17:21:12 2022 +0100

    ofz#45117 Integer-overflow
    
    Change-Id: I1827c1bf3e0153d071b354f9b958d5f84bb2d8a3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130710
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index c2d439eda607..685e923d31e4 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -593,9 +593,9 @@ static int GetCompoundTTOutline(AbstractTrueTypeFont *ttf, 
sal_uInt32 glyphID, C
                 cp.flags = nextComponent[i].flags;
                 const sal_uInt16 x = nextComponent[i].x;
                 const sal_uInt16 y = nextComponent[i].y;
-                t = fixedMulDiv(a, x << 16, m) + fixedMulDiv(c, y << 16, m) + 
sal_Int32(sal_uInt16(e) << 16);
+                t = o3tl::saturating_add(o3tl::saturating_add(fixedMulDiv(a, x 
<< 16, m), fixedMulDiv(c, y << 16, m)), sal_Int32(sal_uInt16(e) << 16));
                 cp.x = static_cast<sal_Int16>(fixedMul(t, m) >> 16);
-                t = fixedMulDiv(b, x << 16, n) + fixedMulDiv(d, y << 16, n) + 
sal_Int32(sal_uInt16(f) << 16);
+                t = o3tl::saturating_add(o3tl::saturating_add(fixedMulDiv(b, x 
<< 16, n), fixedMulDiv(d, y << 16, n)), sal_Int32(sal_uInt16(f) << 16));
                 cp.y = static_cast<sal_Int16>(fixedMul(t, n) >> 16);
 
                 myPoints.push_back( cp );

Reply via email to