diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index b84478611..0a003d56f 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -442,10 +442,9 @@ _create_old_gid_to_new_gid_map (const hb_face_t *face, | hb_sink (reverse_glyph_map) ; - unsigned max_glyph = - + hb_iter (all_gids_to_retain) - | hb_reduce (hb_max, 0u) - ; + hb_codepoint_t max_glyph = HB_SET_VALUE_INVALID; + hb_set_previous (all_gids_to_retain, &max_glyph); + *num_glyphs = max_glyph + 1; }