Files
harfbuzz/test/api
Behdad EsfahbodandClaude Opus 4.8 d8ca8b132d [subset/cff2] Budget the region transforms built for partial instancing
cff2_instancing_plan_t::create() builds k identity tuples of k cells
(then keeps a k-float column per surviving solver tuple) for every
entry of the CFF2 ItemVariationStore's VarData offset array, and
nothing bounded k (a 16-bit region count), the number of entries, or
their aliasing of one VarData.  The work is therefore quadratic in a
font field, so a 12 KB font cost 2.2 GB.

Charge those cells, before they are allocated, to a per-table budget
HB_BUDGET_SUBSET_CFF2_CELLS (2^24 cells) via the existing
hb_budget_spend helper, at both allocation sites (the k*k identity
tuples and the surviving solver columns).  Exhausting it fails create()
like any other planning failure, so the partial instance fails safely
(bounded at ~175 MB worst case) instead of exhausting memory.

Adds test_instance_cff2_vardata_budget: a 6.8 KB font with 40 offsets
aliasing one unused 800-region VarData must fail to partially instance
rather than build a region transform for each; it succeeds (keeping
CFF2 at hundreds of MB) before this change.

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

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-10 19:25:04 -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