[subset] Re-use common Coverage subsetting function in PairPosFormat2.

Was using an identical but less efficient version. Fixes fuzzer test case: https://oss-fuzz.com/testcase-detail/6151390002806784
This commit is contained in:
Garret Rieger 2024-01-08 22:17:55 +00:00 committed by Behdad Esfahbod
parent e0e2b29ea8
commit ef1f5c4e0c
2 changed files with 2 additions and 11 deletions

View file

@ -324,17 +324,8 @@ struct PairPosFormat2_4 : ValueBase
}
}
const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
const hb_map_t &glyph_map = *c->plan->glyph_map;
auto it =
+ hb_iter (this+coverage)
| hb_filter (glyphset)
| hb_map_retains_sorting (glyph_map)
;
out->coverage.serialize_serialize (c->serializer, it);
return_trace (out->class1Count && out->class2Count && bool (it));
bool ret = out->coverage.serialize_subset(c, coverage, this);
return_trace (out->class1Count && out->class2Count && ret);
}