Files
harfbuzz/util
Behdad EsfahbodandClaude Opus 4.8 f2fdcdcd4e [hb-info] Fix two --list-* crashes/garbage on unusual fonts (#6517)
* [hb-info] Skip unresolvable variation sequences in --list-unicodes

_list_unicodes() asserted that every codepoint returned by
hb_face_collect_variation_unicodes() also resolves via
hb_font_get_variation_glyph(), but the library never guarantees
that: collection reads only the cmap format 14 subtable, while
lookup additionally requires a nominal cmap mapping for Default UVS
ranges and a non-zero glyph for Non-Default UVS mappings. A
structurally valid, sanitizer-clean font that lists an unmapped
codepoint in a Default UVS range, or glyph 0 in a Non-Default UVS
entry, therefore aborted hb-info --list-unicodes/--list-all/--all in
any assertion-enabled build (the meson debugoptimized default).

Treat a failed lookup as data and skip the sequence instead of
asserting. Both library calls behave as documented, and the
subsetter relies on collect_variation_unicodes() returning every
listed entry, so the fix belongs in the tool.

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

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* [hb-info] Skip dangling LangSys feature indices in --list-features

The script-sensitive path of _list_features() printed a local
hb_tag_t that hb_ot_layout_table_get_feature_tags() only writes when
the requested index exists. LangSys::sanitize bounds-checks the
feature-index array but not its values, so a featureIndex past the
end of the FeatureList left the tag uninitialised and hb-info printed
stack garbage (NUL bytes under -O2, the previous tag under ASan).

Initialise the tag, resolve it at the top of the per-feature loop,
and honour the returned count by skipping the entry when it is zero,
matching how the shaper ignores such indices. This is a tool-only
defect: the library already returns zero tags for the dangling index.

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

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-30 22:53:55 -06:00
..
2020-07-29 08:44:23 +04:30
2015-04-09 19:16:57 -07:00
2023-01-12 17:04:24 -07:00