[aat] Try fix leak on memory allocation failure

This commit is contained in:
Behdad Esfahbod 2023-01-10 11:29:04 -07:00
parent e122fe2acf
commit 62383315fa
1 changed files with 2 additions and 1 deletions

View File

@ -1137,7 +1137,8 @@ struct mortmorx
{
const Chain<Types> *chain = &firstChain;
unsigned int count = chainCount;
map->chain_flags.resize (count);
if (unlikely (!map->chain_flags.resize (count)))
return;
for (unsigned int i = 0; i < count; i++)
{
map->chain_flags[i].push (hb_aat_map_t::range_flags_t {chain->compile_flags (mapper),