From 62383315fafd973415fa9ea9454f7a1db34b2d4c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 10 Jan 2023 11:29:04 -0700 Subject: [PATCH] [aat] Try fix leak on memory allocation failure --- src/hb-aat-layout-morx-table.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index dbe3127cd..b86d5a05a 100644 --- a/src/hb-aat-layout-morx-table.hh +++ b/src/hb-aat-layout-morx-table.hh @@ -1137,7 +1137,8 @@ struct mortmorx { const Chain *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),