Files
Behdad EsfahbodandClaude Opus 4.8 aad69a017b [instancer] Walk MVAR value records at the source valueRecordSize
MVAR::subset() copied the source valueRecordSize into the output
header but then walked the source array with a typed
VariationValueRecord pointer (8-byte stride) and embedded 8 bytes per
record. For a font whose MVAR uses value records longer than 8 bytes
(valueRecordSize > 8, which the spec and MVAR::sanitize() allow), every
record after the first was read from the wrong offset and the emitted
header described a record array that overlaps the table's own
ItemVariationStore, silently losing metric variations on partial
instancing.

Step through the source records with StructAtOffset at the table's own
valueRecordSize stride, the same way sanitize() and get_var() do, and
declare VariationValueRecord::static_size in the emitted header so it
always matches the 8-byte records that are written. Output for the
usual 8-byte fonts is byte-identical.

Adds a subset regression test (mvar_partial_instance_record_size) built
from NotoSans-VF.abc with its MVAR records re-padded to 12 bytes; its
expected instanced output is byte-identical to the 8-byte
mvar_partial_instance wght=300:600 file and it fails on the unpatched
tree.

Reported by Anthropic's OSS Scanner as ordinary bug ANT-2026-EJUT4BZL.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-08 14:33:10 -06:00
..
2025-04-06 15:50:20 -06:00