Files
harfbuzz/test/api
Behdad EsfahbodandClaude Opus 4.8 b732218126 [paint] Clip sweep-gradient tiles to 0..2π in hb_paint_sweep_gradient_tiles
hb_paint_sweep_gradient_tiles() documents that it iterates the 0..2π
sweep, and all three consumers (hb-cairo mesh patches, the SVG and PDF
writers) size their per-tile loops by tile width on that assumption.
Several emit sites (the start==end PAD case, the first PAD stop past 0,
and repeat/reflect segments straddling 0 or 2π) passed the angles
straight through, and COLRv1 variation deltas can place them hundreds of
thousands of radians outside the circle, so one tile could expand to
millions of patches: a 504-byte variable font drawn off its default
allocated ~1.6 GiB through hb-cairo.

#6157 bounded the number of sweep tiles; this bounds the width of each
one.  Route every emit through a small clipping lambda inside the tiler
that clamps the tile to [0, 2π], lerps the end colours at the clip
points, and drops tiles entirely outside, so the contract holds at the
single place it is established rather than in each backend.
HB_PAINT_MAX_SWEEP_TILES and the repeat-loop bounds are untouched;
external callers need no change.

Adds a regression test calling the public function with far-out angles
for PAD/REPEAT/REFLECT; it fails without the fix.

Follow-up to #6157.

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-GCNW3SND.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-30 16:15:07 -06:00
..
2025-04-06 18:08:50 -06:00
2026-07-30 19:02:25 -06:00
2026-09-04 14:14:49 -06:00
2026-07-31 04:31:26 +03:00
2025-04-05 22:37:10 -06:00
2020-01-31 16:37:30 -05:00
2020-01-15 13:36:01 -08:00
2025-06-08 13:43:27 +03:00