Files
harfbuzz/test/api
Behdad EsfahbodandClaude Opus 4.8 292942ceca [COLR] Charge gradient color stops to the paint session work budget
The COLRv1 paint walk bounds paint-table visits (HB_MAX_NESTING_LEVEL,
HB_MAX_GRAPH_EDGE_COUNT) but handed out ColorLine stops uncharged, so a
single 65535-stop ColorLine shared across up to 16384 gradient edges
could deliver ~10^9 stops from one hb_font_paint_glyph() call, keeping
the rendering thread busy for minutes per glyph in every backend.

Give hb_paint_context_t the session's live budget via
funcs->get_budget_remaining_ptr(), with the same local HB_BUDGET_GLYPH
fallback hb_draw_session_t uses, charge HB_BUDGET_16 per stop delivered
in ColorLine::get_color_stops() (the one place every consumer fetches
stops, so vector, raster, cairo and client paint functions are all
covered), and make recurse() skip further paints once the budget is
negative, as it already does for an oversized graph.  The backend's one
budget is only spent, never re-armed, so this does not reintroduce the
cross-subsystem budget multiplication removed in #6147.  hb-ft-colr.hh
has the same shape and gets the identical change.

With the default 2^24 budget about a million stops per session are
delivered before the rest of the walk is skipped best-effort.  A
separate quadratic cost inside cairo's own gradient pattern building is
not addressed here.  Adds a regression test that fails without the fix.

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

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-30 16:14:51 -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