Files
harfbuzz/test/api/fonts
Behdad EsfahbodandClaude Opus 4.8 8d01a1b148 [subset/cff2] Budget the region transforms built for partial instancing (#6635)
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-11 13:12:41 -06:00
..
2018-11-25 01:16:01 -05:00
2020-01-23 10:50:52 -08:00
2023-01-24 18:08:22 -07:00
2018-11-03 22:28:30 +03:30
2018-10-18 13:04:41 -07:00
2018-10-22 10:17:31 +02:00
2018-10-22 10:17:31 +02:00
2020-01-31 16:37:30 -05:00
2022-02-18 18:27:02 -06:00
2022-12-23 13:37:59 -07:00
2020-01-15 13:36:01 -08:00
2020-01-15 13:36:01 -08:00
2020-02-06 11:35:48 +03:30

cmap-format12-only files created by ttx & remove all other cmap entries

Inconsolata-Regular.abc.widerc.ttf has the hmtx width of "c" set to 600; everything else is 500. Subsetting out c should reduce numberOfHMetrics to 1.

chromacheck-* fonts are from https://github.com/RoelN/ChromaCheck/tree/master/fonts and licensed under MIT by Roel Nieskens and Google.

RanaKufi-Regular.subset.otf is from https://github.com/alif-type/rana-kufi/ but the subset is licensed for us in MIT for the project use.

glyphs.ttf is from https://github.com/RazrFalcon/ttf-parser/blob/337e7d1/tests/fonts/glyphs.ttf

Estedad-VF.ttf, licensed under OFL 1.1, is from https://github.com/aminabedi68/Estedad

graphite2-expansion.ttf is a synthetic three-glyph font generated by
../generate-graphite2-expansion-font.py. Its Graphite substitution rule expands
each "a" to 41 glyphs, for testing buffer growth failure.