mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-29 09:34:05 +01:00
GSUB_accelerator_t::depend() resolved each feature tag separately: it ran hb_ot_layout_collect_features() once per tag and, for every tag, walked the whole FeatureVariations table looking for substitute features. Tables with many features and many FeatureVariations records were therefore quadratic, work that sanitize() bounds only for a single pass. Query all tags at once, then visit each feature once and each FeatureVariations substitute once (via new visit_substitutes() helpers), mapping every lookup to the tag of the feature it belongs to. The emitted dependency graphs are unchanged. Adds a regression test building a FeatureVariations GSUB whose features have no direct lookups. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-5C2QXX5N. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>