mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-19 14:01:10 +01:00
SingleSubstFormat2 already picks, per closure visit, between walking its whole Coverage and iterating the (usually small) active glyph set. The Multiple/Alternate/Ligature/ReverseChain closure and depend paths, the format-1 (Chain)Context closure, and Coverage::intersect_set lacked that choice, so a nested lookup visited many times over a small active set re-walked a large Coverage every time, giving quadratic GSUB closure (and thus subsetting) time. Add the same get_population()-based fast path to those paths and to CoverageFormat1/2::intersect_set. Output is byte-identical; only the per-visit work is bounded. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-KNHDK379. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>