From 014ae09d445e2d7a56c9ed064edd965565dfd4e7 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 4 Jun 2026 12:00:00 +0200 Subject: [PATCH] [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 --- src/hb-ot-layout-gsubgpos.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index 60543f486..896b8170b 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -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;