Files
harfbuzz/test/api
Behdad EsfahbodandClaude Opus 4.8 f87e9d774c [gvar] Charge tuple region eval and point-number decoding to work budget (#6654)
apply_deltas_to_points() only charged the glyph work budget
(HB_BUDGET_GLYPH) for tuple variations that actually applied, and
only by the glyph's point count, after calculate_scalar() had
already walked gvar.axisCount axes for every tuple header.  A
~35 KB font with axisCount 8192 and 4095 non-applying tuples on a
composite-multiplied glyph could hold one hb_font_get_glyph_extents()
call for over a minute while using ~3% of the budget.  Two further
pieces of work were also uncharged: the shared point-number list is
decoded on every glyph load, and an applied tuple decodes/applies
indices.length deltas, which can exceed the point count charged.

Following the project's "charge before doing the work" idiom
(#6256, #6410), charge 1 + axisCount per tuple before its region is
evaluated (bounding calculate_scalar() regardless of the scalar
cache or outcome), shared_indices.length once per load after the
shared point numbers are decoded, and indices.length per applied
tuple before its deltas are decoded.  A font whose tuple work
exceeds the budget now fails the glyph load (outline/extents return
false) instead of finishing slowly; real fonts (a dozen axes, tens
of tuples) pay a few hundred units per load.

Adds test_hb_draw_gvar_budget to test/api/test-draw.c covering both
the unapplied-tuple region charge and the point-number charges.

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

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-11 20:38:47 -06:00
..
2025-04-06 18:08:50 -06:00
2026-07-30 19:02:25 -06:00
2026-07-31 04:31:26 +03:00
2025-04-05 22:37:10 -06:00
2020-01-15 13:36:01 -08:00
2025-06-08 13:43:27 +03:00