diff --git a/src/hb-ot-cff1-table.hh b/src/hb-ot-cff1-table.hh index ce97182e1..4aa337f78 100644 --- a/src/hb-ot-cff1-table.hh +++ b/src/hb-ot-cff1-table.hh @@ -406,6 +406,8 @@ struct Charset1_2 { void collect_glyph_to_sid_map (hb_map_t *mapping, unsigned int num_glyphs) const { hb_codepoint_t gid = 1; + if (gid >= num_glyphs) + return; for (unsigned i = 0;; i++) { hb_codepoint_t sid = ranges[i].first;