Skip to content

ft2font: Make glyph loading failures more robust - #32226

Open
QuLogic wants to merge 1 commit into
matplotlib:mainfrom
QuLogic:ft2font-load-failure
Open

ft2font: Make glyph loading failures more robust#32226
QuLogic wants to merge 1 commit into
matplotlib:mainfrom
QuLogic:ft2font-load-failure

Conversation

@QuLogic

@QuLogic QuLogic commented Aug 18, 2026

Copy link
Copy Markdown
Member

PR summary

The main fix is to FT2Font::load_char, which didn't correctly fail if no fallback was defined to catch missing glyphs.

Also, while PyGlyph_from_FT2Font is internal and should never be called before loading a glyph, add a check in there anyway, just to be safe.

Fixes #32224

AI Disclosure

None

PR quality check

  • Use an expressive title, e.g. "Fix title font property precedence"
  • New and changed code is tested
  • [n/a] Plotting related features are demonstrated in an example
  • [n/a] New features and API changes have release notes
  • [n/a] Documentation complies with general and docstring guidelines

The main fix is to `FT2Font::load_char`, which didn't correctly fail if
no fallback was defined to catch missing glyphs.

Also, while `PyGlyph_from_FT2Font` is internal and should never be
called before loading a glyph, add a check in there anyway, just to be
safe.
@QuLogic QuLogic added this to the v3.11.2 milestone Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: FT2Font.load_char() segfaults (null-pointer dereference)

1 participant