mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 15:25:54 -04:00
pnmtext: Fix loading an invalid font resulting in a crash
Related to #1140
This commit is contained in:
parent
addbc8a2e8
commit
4a7d03d9b1
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user