vcl/source/fontsubset/sft.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit cda1dbd978dba5bb8cd64ab28173a579133d4711
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Sep 14 09:11:52 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Sep 14 11:48:18 2022 +0200

    ofz#51205 Timeout
    
    the len here gets eventually assigned to sal_uInt16 of GlyphData::npoints
    
    Change-Id: If8217f5d414d1e627829df6a20d0c544a920e9ed
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139906
    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 955e70b347c6..7e9d6e69ceff 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -675,6 +675,12 @@ static int GetCompoundTTOutline(AbstractTrueTypeFont *ttf, 
sal_uInt32 glyphID, C
 
         free(nextComponent);
 
+        if (myPoints.size() > SAL_MAX_UINT16) {
+            SAL_WARN("vcl.fonts", "number of points has to be limited to max 
value GlyphData::npoints can contain, abandon effort");
+            myPoints.clear();
+            break;
+        }
+
     } while (flags & MORE_COMPONENTS);
 
     // #i123417# some fonts like IFAOGrec have no outline points in some 
compound glyphs

Reply via email to