From 77507a1d8d872d8cd4f62b807e933cd3e2cdb110 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Fri, 10 Dec 2021 14:10:04 -0800 Subject: [PATCH] [subset] Don't double count visit lookups in closure_lookups Each recursed lookup was getting counted once in closure_lookups() and then again in hb_closure_lookups_context_t::recurse. --- src/hb-ot-layout-gsubgpos.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index 46f55315f..191d3bebc 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -214,7 +214,11 @@ struct hb_closure_lookups_context_t : return; /* Return if new lookup was recursed to before. */ - if (is_lookup_visited (lookup_index)) + if (lookup_limit_exceeded () + || visited_lookups->in_error () + || visited_lookups->has (lookup_index)) + // Don't increment lookup count here, that will be done in the call to closure_lookups() + // made by recurse_func. return; nesting_level_left--;