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

New commits:
commit de3f19062a84890fc89cd4836512ded5b5d82b94
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Mar 8 20:01:04 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Mar 8 22:00:58 2022 +0100

    ofz: Timeout, give up earlier with a broken font
    
    Change-Id: Iccaedebe94db567cb248e0263d03983fc42b5d3d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131224
    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 f650703090d2..681e974dc8a2 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -583,16 +583,19 @@ static int GetCompoundTTOutline(AbstractTrueTypeFont 
*ttf, sal_uInt32 glyphID, C
 
         glyphlist.push_back( index );
 
-        if ((np = GetTTGlyphOutline(ttf, index, &nextComponent, nullptr, 
&glyphlist)) == 0)
+        np = GetTTGlyphOutline(ttf, index, &nextComponent, nullptr, 
&glyphlist);
+
+        if( ! glyphlist.empty() )
+            glyphlist.pop_back();
+
+        if (np == 0)
         {
             /* XXX that probably indicates a corrupted font */
             SAL_WARN("vcl.fonts", "An empty compound!");
             /* assert(!"An empty compound"); */
+            return 0;
         }
 
-        if( ! glyphlist.empty() )
-            glyphlist.pop_back();
-
         if ((flags & USE_MY_METRICS) && metrics)
             GetMetrics(ttf, index, metrics);
 

Reply via email to