[layout] Allocate full GDEF v1.4 header

GDEF subsetting started by allocating only the base v1.0 header
and then tried to extend the final v1.4 tail field directly.
That jumps over the intervening v1.4 offsets and can trip the
serializer head assertion under CIFuzz.

Keep the existing incremental allocation for v1.2/v1.3 so GDEF
downgrade snapshots can still trim those tails, but allocate the
full version-dependent header before writing v1.4 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 93d2aa8ec9
commit e93552fa09
1 file changed
+1 -1
+1 -1
View File
@@ -675,7 +675,7 @@ struct GDEF
(glyphClassDef2 || attachList2 || ligCaretList2 ||
markAttachClassDef2 || markGlyphSetsDef2);
if (unlikely (version.to_int () >= 0x00010004u && hb_barrier () &&
!c->serializer->extend_min (&out->markGlyphSetsDef2)))
!c->serializer->extend_size (out, get_size ())))
return_trace (false);
#endif