freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] GSoC-2019-moazin 4983d02 04/11: Check if the size has been p


From: Moazin Khatti
Subject: [freetype2] GSoC-2019-moazin 4983d02 04/11: Check if the size has been properly set.
Date: Fri, 16 Aug 2019 04:30:02 -0400 (EDT)

branch: GSoC-2019-moazin
commit 4983d02bea2184c39c444db913f6bf488415ba2d
Author: Moazin Khatti <address@hidden>
Commit: Moazin Khatti <address@hidden>

    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.
---
 src/cff/cffgload.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 1c1fb93..3373389 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 );



reply via email to

[Prev in Thread] Current Thread [Next in Thread]