Skip to content

Commit

Permalink
pnmtext: Fix loading an invalid font resulting in a crash
Browse files Browse the repository at this point in the history
Related to #1140
  • Loading branch information
rdb committed Apr 8, 2021
1 parent addbc8a commit 4a7d03d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions panda/src/pnmtext/freetypeFont.cxx
Expand Up @@ -108,12 +108,14 @@ load_font(const Filename &font_filename, int face_index) {
vfs->resolve_filename(path, get_model_path());
exists = vfs->read_file(path, _face->_font_data, true);
if (exists) {
FT_Face face;
FT_Face face = 0;
error = FT_New_Memory_Face(_face->_ft_library,
(const FT_Byte *)_face->_font_data.data(),
_face->_font_data.length(),
face_index, &face);
_face->set_face(face);
if (face) {
_face->set_face(face);
}
}

bool okflag = false;
Expand Down

0 comments on commit 4a7d03d

Please sign in to comment.