During subset input creation check for set alloc failures and fail if encountered.

This commit is contained in:
Garret Rieger 2021-08-23 15:33:57 -07:00 committed by Behdad Esfahbod
parent b5177d2147
commit fb07f8f876
2 changed files with 12 additions and 0 deletions

View File

@ -55,6 +55,18 @@ hb_subset_input_create_or_fail (void)
input->drop_tables = hb_set_create (); input->drop_tables = hb_set_create ();
input->no_subset_tables = hb_set_create (); input->no_subset_tables = hb_set_create ();
if (unlikely (input->unicodes->in_error ()
|| input->glyphs->in_error ()
|| input->name_ids->in_error ()
|| input->name_languages->in_error ()
|| input->layout_features->in_error ()
|| input->drop_tables->in_error ()
|| input->no_subset_tables->in_error ()))
{
hb_subset_input_destroy (input);
return nullptr;
}
input->flags = HB_SUBSET_FLAGS_DEFAULT; input->flags = HB_SUBSET_FLAGS_DEFAULT;
hb_tag_t default_drop_tables[] = { hb_tag_t default_drop_tables[] = {