mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-23 07:51:10 +01:00
[COLR] Widen clip coordinates
COLR clip rectangles add full-range glyph bearings and dimensions before passing them to the floating-point paint API. Convert endpoints to float before the additions so signed position arithmetic cannot overflow. This is part of the complete 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
f222478bcc
commit
4281443dcd
1 file changed
+8
-8
@@ -2881,10 +2881,10 @@ struct COLR
|
||||
|
||||
if (clip)
|
||||
c.funcs->push_clip_rectangle (c.data,
|
||||
extents.x_bearing,
|
||||
extents.y_bearing + extents.height,
|
||||
extents.x_bearing + extents.width,
|
||||
extents.y_bearing);
|
||||
(float) extents.x_bearing,
|
||||
(float) extents.y_bearing + extents.height,
|
||||
(float) extents.x_bearing + extents.width,
|
||||
(float) extents.y_bearing);
|
||||
|
||||
if (is_bounded)
|
||||
c.recurse (*paint);
|
||||
@@ -3014,10 +3014,10 @@ void PaintColrGlyph::paint_glyph (hb_paint_context_t *c) const
|
||||
|
||||
if (has_clip_box)
|
||||
c->funcs->push_clip_rectangle (c->data,
|
||||
extents.x_bearing,
|
||||
extents.y_bearing + extents.height,
|
||||
extents.x_bearing + extents.width,
|
||||
extents.y_bearing);
|
||||
(float) extents.x_bearing,
|
||||
(float) extents.y_bearing + extents.height,
|
||||
(float) extents.x_bearing + extents.width,
|
||||
(float) extents.y_bearing);
|
||||
|
||||
if (paint)
|
||||
c->recurse (*paint);
|
||||
|
||||
Reference in new issue
Block a user