summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoazin Khatti <moazinkhatri@gmail.com>2019-08-09 13:42:07 +0500
committerMoazin Khatti <moazinkhatri@gmail.com>2019-08-26 01:17:14 +0500
commit705320b72d67d7a03d992391b0fa90b4b4a08498 (patch)
tree2f8d62957336c36ff77bd2e35a9726fd2e45f6cf
parentfdb7d53ebf32fda7dae9dc32daabfeed0ed95df4 (diff)
downloadfreetype2-705320b72d67d7a03d992391b0fa90b4b4a08498.tar.gz
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.
-rw-r--r--src/cff/cffgload.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 1c1fb9353..33733896a 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -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 );