summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-03-08 20:01:04 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-03-08 22:00:58 +0100
commitde3f19062a84890fc89cd4836512ded5b5d82b94 (patch)
treef9b4553efdffed7c2dbaae2db2e506165d02aa1a /vcl
parentee116e166286d2fe0f35f1759c126d4207ee213f (diff)
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 <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/fontsubset/sft.cxx11
1 files changed, 7 insertions, 4 deletions
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);