[khmer] Fix infinite-loop in cluster merging

Indic shaper already had this check.  We removed it when forking
Khmer shaper by mistake.

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1464623
This commit is contained in:
Behdad Esfahbod 2018-06-30 09:16:54 +04:30
parent 25970a93aa
commit 7b8dfac560
1 changed files with 17 additions and 14 deletions

View File

@ -372,6 +372,9 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
break; break;
} }
if (unlikely (end - start >= 127))
buffer->merge_clusters (start, end);
else
/* Note! syllable() is a one-byte field. */ /* Note! syllable() is a one-byte field. */
for (unsigned int i = base; i < end; i++) for (unsigned int i = base; i < end; i++)
if (info[i].syllable() != 255) if (info[i].syllable() != 255)