[subset] Simplify recent out-of-memory fixes
By checking return status of map->set().
This commit is contained in:
parent
a8f9f85a91
commit
9ed5f04a70
|
@ -701,10 +701,10 @@ struct Script
|
|||
if (!c->script_langsys_map->has (script_index))
|
||||
{
|
||||
hb_set_t* empty_set = hb_set_create ();
|
||||
c->script_langsys_map->set (script_index, empty_set);
|
||||
if (!c->script_langsys_map->has (script_index)) {
|
||||
hb_set_destroy (empty_set);
|
||||
return;
|
||||
if (unlikely (!c->script_langsys_map->set (script_index, empty_set)))
|
||||
{
|
||||
hb_set_destroy (empty_set);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -108,12 +108,12 @@ struct hb_closure_context_t :
|
|||
|
||||
if (!done_lookups_glyph_set->get (lookup_index))
|
||||
{
|
||||
hb_set_t* empty_set = hb_set_create ();
|
||||
done_lookups_glyph_set->set (lookup_index, empty_set);
|
||||
if (!done_lookups_glyph_set->get (lookup_index)) {
|
||||
hb_set_destroy (empty_set);
|
||||
return true;
|
||||
}
|
||||
hb_set_t* empty_set = hb_set_create ();
|
||||
if (unlikely (!done_lookups_glyph_set->set (lookup_index, empty_set)))
|
||||
{
|
||||
hb_set_destroy (empty_set);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
done_lookups_glyph_set->get (lookup_index)->clear ();
|
||||
|
|
Loading…
Reference in New Issue