Check if the size has been properly set.

For TTF outlines this is already handled, however,
for traditional CFF outlines the check happens too
late. We need to check early.
This commit is contained in:
Moazin Khatti 2019-08-09 13:42:07 +05:00
parent fdb7d53ebf
commit 705320b72d
1 changed files with 7 additions and 0 deletions

View File

@ -358,6 +358,13 @@
FT_UShort advanceX;
FT_UShort advanceY;
if ( ( size->root.metrics.x_ppem < 1 ||
size->root.metrics.y_ppem < 1 ) )
{
error = FT_THROW( Invalid_Size_Handle );
return error;
}
FT_TRACE3(( "Attemping to load SVG glyph\n" ));
sfnt = (SFNT_Service)((TT_Face)glyph->root.face)->sfnt;
error = sfnt->load_svg_doc( (FT_GlyphSlot)glyph, glyph_index );