From d18fd3f7ebcd75e99c928c52fabfc51359000d26 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 31 Jan 2023 16:28:49 -0700 Subject: [PATCH] [layout] Comment --- src/hb-ot-layout-gsubgpos.hh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index 8d0f40005..bf74672a1 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -4021,6 +4021,11 @@ struct hb_ot_layout_lookup_accelerator_t HB_VAR_ARRAY * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t) + count * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t); + /* The following is a calloc because when we are collecting subtables, + * some of them might be invalid and hence not collect; as a result, + * we might not fill in all the count entries of the subtables array. + * Zeroing it allows the set digest to gatekeep it without having to + * initialize it further. */ auto *thiz = (hb_ot_layout_lookup_accelerator_t *) hb_calloc (1, size); if (unlikely (!thiz)) return nullptr;