| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| bool fallback = true; | ||
| FT2Font *ft_object = nullptr; | ||
|
|
||
| self->load_char(charcode, static_cast<FT_Int32>(flags), ft_object, fallback); |
There was a problem hiding this comment.
I'm worried about a future change to load_char() failing to fill ft_object. A subsequent call to PyGlyph_from_FT2Font() will crash due to the nullptr dereference.
From a C/Obj-C background, I'd like to see an explicit check against nullptr after this call and an exception thrown if nullptr. However, I'm not sure if that matches our C++.
The PR addresses the original bug; however, and I'm fine with approving it as-is.
Sorry, something went wrong.
There was a problem hiding this comment.
That's also a pretty reasonable thing to check.
Sorry, something went wrong.
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.
There was a problem hiding this comment.
Looks good now!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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