From e7ce50d9eb6e3678f731b10dfeb308ffc478af8d Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod <behdad@behdad.org> Date: Wed, 16 Jul 2014 12:30:39 -0400 Subject: [PATCH] [indic] Fix access past end of array --- src/hb-ot-shape-complex-indic.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 02087a05c..5bb1f3382 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -1372,9 +1372,10 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan, if (base == end && start < base && is_one_of (info[base - 1], FLAG (OT_ZWJ))) base--; - while (start < base && - is_one_of (info[base], (FLAG (OT_N) | HALANT_OR_COENG_FLAGS))) - base--; + if (base < end) + while (start < base && + is_one_of (info[base], (FLAG (OT_N) | HALANT_OR_COENG_FLAGS))) + base--; /* o Reorder matras: