From 453ded05392af38bba9f89587edce465e86ffa6b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 28 Mar 2023 13:17:15 -0600 Subject: [PATCH] [indic] Tighten up base-finding Fixes https://github.com/harfbuzz/harfbuzz/issues/4185 --- src/hb-ot-shaper-indic.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-shaper-indic.cc b/src/hb-ot-shaper-indic.cc index e3818cc37..f8c970fc3 100644 --- a/src/hb-ot-shaper-indic.cc +++ b/src/hb-ot-shaper-indic.cc @@ -1067,12 +1067,15 @@ final_reordering_syllable_indic (const hb_ot_shape_plan_t *plan, base = i; while (base < end && is_halant (info[base])) base++; - info[base].indic_position() = POS_BASE_C; + if (base < end) + info[base].indic_position() = POS_BASE_C; try_pref = false; } break; } + if (base == end) + break; } /* For Malayalam, skip over unformed below- (but NOT post-) forms. */ if (buffer->props.script == HB_SCRIPT_MALAYALAM)