From 6b62d3678bbf9f5ee3c0e680ca03dc4b235b7ddb Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 25 Aug 2025 14:02:59 -0600 Subject: [PATCH] [ligature-cache] Handle case of ligature with no components (#5500) In the cache with "seconds" set-digest. --- src/OT/Layout/GSUB/Ligature.hh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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