Skip to content

Commit 874f281

Browse files
authored
Merge pull request matplotlib#31631 from meeseeksmachine/auto-backport-of-pr-31557-on-v3.11.x
Backport PR matplotlib#31557 on branch v3.11.x (FIX: Added ft2font null checks added)
2 parents a475926 + f05f7a2 commit 874f281

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/ft2font.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ inline char const* ft_error_string(FT_Error error) {
4141
#undef __FTERRORS_H__
4242
#define FT_ERROR_START_LIST switch (error) {
4343
#define FT_ERRORDEF( e, v, s ) case v: return s;
44-
#define FT_ERROR_END_LIST default: return NULL; }
44+
#define FT_ERROR_END_LIST default: return "unknown error"; }
4545
#include FT_ERRORS_H
4646
}
4747

src/ft2font_wrapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,9 @@ class PyFT2Font final : public FT2Font
409409
{
410410
std::set<FT_String*>::iterator it = family_names.begin();
411411
std::stringstream ss;
412-
ss<<*it;
412+
ss<< (*it ? *it : "unknown family name");
413413
while(++it != family_names.end()){
414-
ss<<", "<<*it;
414+
ss<<", "<< (*it ? *it : "unknown family name");
415415
}
416416

417417
auto text_helpers = py::module_::import("matplotlib._text_helpers");

0 commit comments

Comments
 (0)