From 4281443dcdd18725e6bdccafbbfd42d80069a087 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 12 Aug 2026 18:29:03 -0600 Subject: [PATCH] [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 --- src/OT/Color/COLR/COLR.hh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/OT/Color/COLR/COLR.hh b/src/OT/Color/COLR/COLR.hh index f37fa5c51..f102133a5 100644 --- a/src/OT/Color/COLR/COLR.hh +++ b/src/OT/Color/COLR/COLR.hh @@ -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);