From 416d87963fc96b892271f0cb176c761690e4c403 Mon Sep 17 00:00:00 2001 From: Jon Anderson Date: Fri, 6 Feb 2015 10:16:45 +0100 Subject: [PATCH] [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. --- ChangeLog | 8 ++++++++ src/truetype/ttgload.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index bf605426e..7828f2064 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2015-02-06 Jon Anderson + + [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 [autofit] Fix potential memory leak. diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 9431a51bd..0b189a50c 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;