[layout] Allocate full GSUB/GPOS v1.2 header

GSUB/GPOS subsetting started by allocating only the base v1.0
header, then jumped directly to lookupList2 for v1.2 tables. That
can pass a pointer beyond the serializer head to extend_min(), which
asserts under fuzzing.

Keep the old incremental allocation for v1.0/v1.1 tables so feature
variation downgrade snapshots can still trim the tail, but allocate
the full version-dependent header before writing v1.2 offsets.

Testing: meson test -C build --suite subset
Testing: meson test -C build

Assisted-by: OpenAI Codex
This commit is contained in:
Behdad Esfahbod committed 2026-06-05 12:34:52 +02:00
1 parent 336d65cdab
commit 014ae09d44
1 file changed
+1 -1
+1 -1
View File
@@ -4733,7 +4733,7 @@ struct GSUBGPOS
#ifndef HB_NO_BEYOND_64K
if (version.to_int () >= 0x00010002u)
{
if (unlikely (!c->subset_context->serializer->extend_min (&out->lookupList2)))
if (unlikely (!c->subset_context->serializer->extend_size (out, get_size ())))
return_trace (false);
out->scriptList = 0;