[truetype] Adjust number of glyphs for malformed `loca' tables. * src/truetype/ttpload.c (tt_face_load_loca): Implement it.
diff --git a/ChangeLog b/ChangeLog
index 021a34a..de74213 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-09-30 Werner Lemberg <wl@gnu.org>
+
+ [truetype] Adjust number of glyphs for malformed `loca' tables.
+
+ * src/truetype/ttpload.c (tt_face_load_loca): Implement it.
+
2015-09-29 Werner Lemberg <wl@gnu.org>
[pshinter] Avoid harmless overflow (#45984).
diff --git a/src/truetype/ttpload.c b/src/truetype/ttpload.c
index fb338bd..4647c93 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 ));
+ }
}
}