summaryrefslogtreecommitdiff
path: root/vcl/source/fontsubset/sft.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/fontsubset/sft.cxx')
-rw-r--r--vcl/source/fontsubset/sft.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index f59c26da4f0c..00c46d3caf1f 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -506,9 +506,9 @@ static int GetCompoundTTOutline(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, C
if( std::find( glyphlist.begin(), glyphlist.end(), index ) != glyphlist.end() )
{
-#if OSL_DEBUG_LEVEL > 1
- SAL_INFO("vcl.fonts", "Endless loop found in a compound glyph.");
+ SAL_WARN("vcl.fonts", "Endless loop found in a compound glyph.");
+#if OSL_DEBUG_LEVEL > 1
std::ostringstream oss;
oss << index << " -> [";
for( const auto& rGlyph : glyphlist )
@@ -519,6 +519,7 @@ static int GetCompoundTTOutline(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, C
SAL_INFO("vcl.fonts", oss.str());
/**/
#endif
+ return 0;
}
glyphlist.push_back( index );
@@ -526,10 +527,8 @@ static int GetCompoundTTOutline(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, C
if ((np = GetTTGlyphOutline(ttf, index, &nextComponent, nullptr, &glyphlist)) == 0)
{
/* XXX that probably indicates a corrupted font */
-#if OSL_DEBUG_LEVEL > 1
SAL_WARN("vcl.fonts", "An empty compound!");
/* assert(!"An empty compound"); */
-#endif
}
if( ! glyphlist.empty() )
@@ -1417,6 +1416,12 @@ int GetTTGlyphComponents(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, std::vec
if (nptr <= ptr)
return 0;
+ if (std::find(glyphlist.begin(), glyphlist.end(), glyphID) != glyphlist.end())
+ {
+ SAL_WARN("vcl.fonts", "Endless loop found in a compound glyph.");
+ return 0;
+ }
+
glyphlist.push_back( glyphID );
const sal_uInt32 nMaxGlyphSize = glyflength - nOffset;