[buffer] When deleting glyphs, check cluster backwards as well

This commit is contained in:
Behdad Esfahbod 2022-05-31 09:35:49 -06:00
parent 0384f80e78
commit 9c0c31dfaa
1 changed files with 2 additions and 1 deletions

View File

@ -543,7 +543,8 @@ hb_buffer_t::delete_glyph ()
/* The logic here is duplicated in hb_ot_hide_default_ignorables(). */
unsigned int cluster = info[idx].cluster;
if (idx + 1 < len && cluster == info[idx + 1].cluster)
if ((idx + 1 < len && cluster == info[idx + 1].cluster) ||
(out_len && cluster == out_info[out_len - 1].cluster))
{
/* Cluster survives; do nothing. */
goto done;