mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 04:06:14 +00:00
Fix crash when executing FontFile.get_face_count
This commit is contained in:
parent
24115beb3c
commit
2d0d6e4f63
@ -1940,12 +1940,12 @@ int64_t TextServerAdvanced::font_get_face_count(const RID &p_font_rid) const {
|
||||
fargs.flags = FT_OPEN_MEMORY;
|
||||
fargs.stream = &stream;
|
||||
|
||||
FT_Face tmp_face;
|
||||
FT_Face tmp_face = nullptr;
|
||||
error = FT_Open_Face(ft_library, &fargs, -1, &tmp_face);
|
||||
if (error == 0) {
|
||||
face_count = tmp_face->num_faces;
|
||||
FT_Done_Face(tmp_face);
|
||||
}
|
||||
FT_Done_Face(tmp_face);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1039,12 +1039,12 @@ int64_t TextServerFallback::font_get_face_count(const RID &p_font_rid) const {
|
||||
fargs.flags = FT_OPEN_MEMORY;
|
||||
fargs.stream = &stream;
|
||||
|
||||
FT_Face tmp_face;
|
||||
FT_Face tmp_face = nullptr;
|
||||
error = FT_Open_Face(ft_library, &fargs, -1, &tmp_face);
|
||||
if (error == 0) {
|
||||
face_count = tmp_face->num_faces;
|
||||
FT_Done_Face(tmp_face);
|
||||
}
|
||||
FT_Done_Face(tmp_face);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user