Files
harfbuzz/src
Behdad EsfahbodandClaude Opus 4.8 6aa278829e [subset] Charge gvar avar2 culling pass to the source table size (#6641)
In a well-formed gvar the per-glyph data ranges [offset[i],
offset[i+1]) are disjoint, so the retained glyphs' data add up to at
most the table.  gvar::subset()'s avar2 culling pass used the offsets
as they are, so malformed offsets (0, D, 0, D, ...) could point
thousands of glyphs at one 128 KB block; the pass parsed, rewrote and
kept a heap copy of it once per glyph, repeated on each of the
serializer's buffer-doubling retries (26 s and 1.3 GiB from a 251 KB
font before it was rejected).

Restore the invariant where the pass is driven: charge each retained
glyph's byte length to a budget equal to the source blob length with
hb_budget_spend(), and on exhaustion raise HB_SERIALIZE_ERROR_OTHER
so _hb_subset_table_try() does not retry.  A spec-conforming table
can never reach the limit, so there is no tuning constant and valid
fonts subset byte-identically; a font whose retained glyphs' gvar
ranges overlap by more than the table length now fails avar2 partial
instancing.

Adds test_avar2_culling_aliased_gvar_data to test/api/test-subset-avar2.c.

The non-avar2 instantiate() branch trusts the same offsets and is
not touched here.

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

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-11 17:04:43 -06:00
..
2026-08-12 18:27:23 -06:00
2024-03-30 02:20:21 +02:00
2026-07-31 04:31:26 +03:00
2026-07-31 04:31:26 +03:00
…
2025-10-17 15:23:05 -06:00
…
2026-11-04 23:03:36 +02:00
2026-09-21 00:41:07 +03:00
2026-09-21 00:41:07 +03:00
2026-09-21 00:41:07 +03:00
2026-10-16 00:19:21 +03:00
2025-03-24 00:33:53 +02:00
2025-09-15 23:56:25 -06:00
…
…
2026-04-20 05:10:48 +02:00
2026-04-20 05:10:48 +02:00
2024-10-27 16:14:53 -07:00
…
2026-10-22 17:05:31 +03:00
2023-08-25 07:51:05 -06:00
…
2025-04-08 01:58:10 -06:00
2025-08-07 22:38:58 -06:00
2026-07-31 17:49:40 +03:00
2026-07-31 17:49:40 +03:00
2025-08-07 22:38:58 -06:00
2026-03-19 00:45:24 +02:00
2024-04-16 17:10:09 -06:00
2026-07-31 04:31:26 +03:00
2026-09-21 00:41:07 +03:00
2026-04-18 10:58:44 -06:00
2026-09-21 00:41:07 +03:00
2026-08-26 22:27:05 +03:00
2026-08-19 16:00:05 -06:00
2025-07-23 21:39:23 +03:00
2024-08-23 08:58:50 -06:00
2026-07-31 17:49:40 +03:00
2025-01-11 18:13:18 +02:00
2026-07-30 12:00:47 -06:00
2026-10-01 16:27:20 -06:00
…
2026-04-20 01:29:49 +02:00
2026-11-04 23:03:36 +02:00
2025-03-07 18:19:29 -07:00
2026-08-12 18:33:09 -06:00
…
2026-06-05 13:44:29 +02:00
…