[morx] Limit context length

Fixes https://github.com/harfbuzz/harfbuzz/issues/3097
This commit is contained in:
Behdad Esfahbod 2022-06-01 07:54:45 -06:00
parent 62e803b361
commit 9e1479b5f0
1 changed files with 1 additions and 1 deletions

View File

@ -123,7 +123,7 @@ struct RearrangementSubtable
bool reverse_l = 3 == (m >> 4);
bool reverse_r = 3 == (m & 0x0F);
if (end - start >= l + r)
if (end - start >= l + r && end-start <= HB_MAX_CONTEXT_LENGTH)
{
buffer->merge_clusters (start, hb_min (buffer->idx + 1, buffer->len));
buffer->merge_clusters (start, end);