[gpos] Limit recursion depth in propagate_attachment_offsets()
Fixes https://github.com/harfbuzz/harfbuzz/issues/2927
This commit is contained in:
parent
449bdeed5f
commit
d15260ca95
|
@ -3022,7 +3022,8 @@ static void
|
||||||
propagate_attachment_offsets (hb_glyph_position_t *pos,
|
propagate_attachment_offsets (hb_glyph_position_t *pos,
|
||||||
unsigned int len,
|
unsigned int len,
|
||||||
unsigned int i,
|
unsigned int i,
|
||||||
hb_direction_t direction)
|
hb_direction_t direction,
|
||||||
|
unsigned nesting_level = HB_MAX_NESTING_LEVEL)
|
||||||
{
|
{
|
||||||
/* Adjusts offsets of attached glyphs (both cursive and mark) to accumulate
|
/* Adjusts offsets of attached glyphs (both cursive and mark) to accumulate
|
||||||
* offset of glyph they are attached to. */
|
* offset of glyph they are attached to. */
|
||||||
|
@ -3037,7 +3038,10 @@ propagate_attachment_offsets (hb_glyph_position_t *pos,
|
||||||
if (unlikely (j >= len))
|
if (unlikely (j >= len))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
propagate_attachment_offsets (pos, len, j, direction);
|
if (unlikely (!nesting_level))
|
||||||
|
return;
|
||||||
|
|
||||||
|
propagate_attachment_offsets (pos, len, j, direction, nesting_level - 1);
|
||||||
|
|
||||||
assert (!!(type & ATTACH_TYPE_MARK) ^ !!(type & ATTACH_TYPE_CURSIVE));
|
assert (!!(type & ATTACH_TYPE_MARK) ^ !!(type & ATTACH_TYPE_CURSIVE));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue