mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-29 09:34:05 +01:00
[GPOS] Saturate resolved cursive offsets
A mark can resolve its cross-stream position through a cursive attachment chain. Saturate that accumulation so an overlong chain cannot overflow hb_position_t while applying GPOS. This is part of the position-overflow fix for issue #6151. Testing: meson test -C build --print-errorlogs Assisted-by: Codex <codex@openai.com>
This commit is contained in:
1 parent
a597884edf
commit
bcce9d4f55
1 file changed
+2
-1
@@ -25,7 +25,8 @@ resolve_cross_offset (const hb_glyph_position_t *pos,
|
||||
if (unlikely (parent >= len))
|
||||
break;
|
||||
glyph_pos = parent;
|
||||
offset += horizontal ? pos[glyph_pos].y_offset : pos[glyph_pos].x_offset;
|
||||
offset = hb_saturate_add (offset,
|
||||
horizontal ? pos[glyph_pos].y_offset : pos[glyph_pos].x_offset);
|
||||
}
|
||||
return offset;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user