diff --git a/ChangeLog b/ChangeLog index 021a34a90..de7421360 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-09-30 Werner Lemberg + + [truetype] Adjust number of glyphs for malformed `loca' tables. + + * src/truetype/ttpload.c (tt_face_load_loca): Implement it. + 2015-09-29 Werner Lemberg [pshinter] Avoid harmless overflow (#45984). diff --git a/src/truetype/ttpload.c b/src/truetype/ttpload.c index fb338bde3..4647c938a 100644 --- a/src/truetype/ttpload.c +++ b/src/truetype/ttpload.c @@ -152,6 +152,14 @@ FT_TRACE2(( "adjusting num_locations to %d\n", face->num_locations )); } + else + { + face->root.num_glyphs = face->num_locations + ? (FT_Long)face->num_locations - 1 : 0; + + FT_TRACE2(( "adjusting num_glyphs to %d\n", + face->root.num_glyphs )); + } } }