Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FIX: Added ft2font null checks added#31557

Open
beelauuu wants to merge 1 commit intomatplotlib:mainfrom
beelauuu:beelauuu/ft2font-null-fixes
Open

FIX: Added ft2font null checks added#31557
beelauuu wants to merge 1 commit intomatplotlib:mainfrom
beelauuu:beelauuu/ft2font-null-fixes

Conversation

@beelauuu
Copy link
Copy Markdown
Contributor

@beelauuu beelauuu commented Apr 23, 2026

PR summary

Fix two potential null pointer crashes in src/ft2font.h and src/ft2font_wrapper.cpp.

1. ft_error_string returning NULL (ft2font.h:44)

Fixed by changing the default case to return "unknown error" instead of NULL, so the function always returns a valid string.

2. NULL family_name streamed in ft_glyph_warn (ft2font_wrapper.cpp:408)

Fixed by guarding each stream insertion with (*it ? *it : "unknown").

AI Disclosure

I used Claude Code to help understand the codebase. The fixes were applied by me.

PR checklist

  • [N/A] "closes #0000" — no linked issue
  • new and changed code is tested
  • [N/A] Plotting related features are demonstrated in an example
  • [N/A] New Features and API Changes are noted with a directive and release note — these are defensive bug fixes with no API changes
  • [N/A] Documentation complies with general and docstring guidelines — no docs changed

@beelauuu beelauuu changed the title ft2font null checks added FIX: Added ft2font null checks added Apr 23, 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.

1 participant