[subset] Limit the number of features processed in the feature closure.

This commit is contained in:
Garret Rieger 2020-02-28 14:11:48 -08:00
parent 410b4881d0
commit 75622b0d24
1 changed files with 2 additions and 1 deletions

View File

@ -3104,7 +3104,8 @@ struct GSUBGPOS
void closure_features (const hb_map_t *lookup_indexes, /* IN */ void closure_features (const hb_map_t *lookup_indexes, /* IN */
hb_set_t *feature_indexes /* OUT */) const hb_set_t *feature_indexes /* OUT */) const
{ {
for (unsigned i = 0; i < get_feature_count (); i++) unsigned int feature_count = hb_min (get_feature_count (), (unsigned) HB_MAX_FEATURE_INDICES);
for (unsigned i = 0; i < feature_count; i++)
{ {
if (get_feature (i).intersects_lookup_indexes (lookup_indexes)) if (get_feature (i).intersects_lookup_indexes (lookup_indexes))
feature_indexes->add (i); feature_indexes->add (i);