From 63afb4f2e7cc6053fb884108b360f19d1103b065 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 26 Apr 2023 10:29:25 -0600 Subject: [PATCH] [syllabic] Better fix for previous issue With previous fix the GPOS application was still reading the syllable() member, which was already freed. This fix is more correct. --- src/hb-ot-layout-gsubgpos.hh | 3 ++- src/hb-ot-shaper-syllabic.cc | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index 07a6db777..e1b66a199 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -487,7 +487,8 @@ struct hb_ot_apply_context_t : /* Ignore ZWJ if we are matching context, or asked to. */ matcher.set_ignore_zwj (context_match || c->auto_zwj); matcher.set_mask (context_match ? -1 : c->lookup_mask); - matcher.set_per_syllable (c->per_syllable); + /* Per syllable matching is only for GSUB. */ + matcher.set_per_syllable (c->table_index == 0 && c->per_syllable); } void set_lookup_props (unsigned int lookup_props) { diff --git a/src/hb-ot-shaper-syllabic.cc b/src/hb-ot-shaper-syllabic.cc index b300e43de..89226ae4a 100644 --- a/src/hb-ot-shaper-syllabic.cc +++ b/src/hb-ot-shaper-syllabic.cc @@ -92,10 +92,6 @@ hb_syllabic_clear_var (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) { - unsigned count = buffer->len; - hb_glyph_info_t *info = buffer->info; - for (unsigned i = 0; i < count; i++) - info[i].syllable() = 0; HB_BUFFER_DEALLOCATE_VAR (buffer, syllable); return false; }