[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.
This commit is contained in:
Jon Anderson 2015-02-06 10:16:45 +01:00 committed by Werner Lemberg
parent b6cb4997e8
commit 416d87963f
2 changed files with 10 additions and 0 deletions

View File

@ -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.

View File

@ -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;