diff --git a/src/OT/Layout/GSUB/Ligature.hh b/src/OT/Layout/GSUB/Ligature.hh index fa9e79678..dfa46b181 100644 --- a/src/OT/Layout/GSUB/Ligature.hh +++ b/src/OT/Layout/GSUB/Ligature.hh @@ -47,7 +47,13 @@ struct Ligature template void collect_second (set_t &s) const { - s.add (component[1]); // This adds codepoint 0 if component array is empty. + if (unlikely (!component.get_length ())) + { + // A ligature without any components. Anything matches. + s = set_t::full (); + return; + } + s.add (component.arrayZ[0]); } bool would_apply (hb_would_apply_context_t *c) const