From abb3239ef92cc5dccb4638806d7ae9868b9ac9b3 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 22 Jul 2012 23:55:19 -0400 Subject: [PATCH] [Indic] Update clusters for left-matra even if matra didn't move Fixes crashes reported with left matra under non-uniscribe-bug-compatibilty mode. --- src/hb-ot-shape-complex-indic.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index ad55f77..47acbdb 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -859,7 +859,8 @@ final_reordering_syllable (hb_buffer_t *buffer, while (new_pos > start && !(FLAG (info[new_pos].indic_category()) & (FLAG (OT_M) | FLAG (OT_H) | FLAG (OT_Coeng)))) new_pos--; - /* If we found no Halant we are done. Otherwise only proceed if the Halant does + /* If we found no Halant we are done (just need to update clusters). + * Otherwise only proceed if the Halant does * not belong to the Matra itself! */ if (is_halant_or_coeng (info[new_pos]) && info[new_pos].indic_position() != POS_PRE_M) { @@ -878,6 +879,12 @@ final_reordering_syllable (hb_buffer_t *buffer, start_of_last_cluster = MIN (new_pos, start_of_last_cluster); new_pos--; } + } else { + for (unsigned int i = start; i < start_of_last_cluster; i++) + if (info[i].indic_position () == POS_PRE_M) { + start_of_last_cluster = i; + break; + } } } -- 2.7.4