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

This commit is contained in:
Behdad Esfahbod committed 2022-06-01 04:52:10 -06:00
1 parent 0384f80e78
commit 9c0c31dfaa
1 file changed
+2 -1
+2 -1
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;