diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index cda1f9a5e..0fe023dea 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -1945,6 +1945,8 @@ struct ContextFormat3 void closure_lookups (hb_closure_lookups_context_t *c) const { + if (!intersects (c->glyphs)) + return; const LookupRecord *lookupRecord = &StructAfter (coverageZ.as_array (glyphCount)); recurse_lookups (c, lookupCount, lookupRecord); } @@ -2910,6 +2912,9 @@ struct ChainContextFormat3 void closure_lookups (hb_closure_lookups_context_t *c) const { + if (!intersects (c->glyphs)) + return; + const OffsetArrayOf &input = StructAfter> (backtrack); const OffsetArrayOf &lookahead = StructAfter> (input); const ArrayOf &lookup = StructAfter> (lookahead);