[subset] Fix fuzzer found memory leak.

Happens because an insert into a map with an invalid key reports successful, but this causes the set being inserted to be lost.
This commit is contained in:
Garret Rieger 2021-11-02 16:16:52 -07:00 committed by Behdad Esfahbod
parent b1cd0dce8e
commit f51b48c8e7
2 changed files with 9 additions and 8 deletions

View File

@ -3694,6 +3694,7 @@ struct GSUBGPOS
for (unsigned i : feature_indices->iter ()) for (unsigned i : feature_indices->iter ())
{ {
hb_tag_t t = get_feature_tag (i); hb_tag_t t = get_feature_tag (i);
if (t == unique_features.INVALID_KEY) continue;
if (!unique_features.has (t)) if (!unique_features.has (t))
{ {
hb_set_t* indices = hb_set_create (); hb_set_t* indices = hb_set_create ();