Commit 416d87963fc96b892271f0cb176c761690e4c403

Jon Anderson 2015-02-06T10:16:45

[truetype] Fix regression in the incremental glyph loader. * src/truetype/ttgload.c (load_truetype_glyph): For incremental fonts, the glyph index may be greater than the number of glyphs indicated, so guard the check with a preprocessor conditional.

diff --git a/ChangeLog b/ChangeLog
index bf60542..7828f20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-02-06  Jon Anderson  <jon@websupergoo.com>
+
+	[truetype] Fix regression in the incremental glyph loader.
+
+	* src/truetype/ttgload.c (load_truetype_glyph): For incremental
+	fonts, the glyph index may be greater than the number of glyphs
+	indicated, so guard the check with a preprocessor conditional.
+
 2015-02-06  Werner Lemberg  <wl@gnu.org>
 
 	[autofit] Fix potential memory leak.
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 9431a51..0b189a5 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1425,12 +1425,14 @@
       goto Exit;
     }
 
+#ifndef FT_CONFIG_OPTION_INCREMENTAL
     /* check glyph index */
     if ( glyph_index >= (FT_UInt)face->root.num_glyphs )
     {
       error = FT_THROW( Invalid_Glyph_Index );
       goto Exit;
     }
+#endif
 
     loader->glyph_index = glyph_index;