Skip to content
Permalink
Browse files
fontengine: Fix crash loading PNG/XML fonts from paths without dot
fixes #11096
  • Loading branch information
sfan5 committed Jun 1, 2021
1 parent c9144ae commit e15cae9fa0f99f597f349a7ba07d149cd91cc2d8
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/client/fontengine.cpp
@@ -342,8 +342,9 @@ gui::IGUIFont *FontEngine::initSimpleFont(const FontSpec &spec)
(spec.mode == FM_SimpleMono) ? "mono_font_path" : "font_path");

size_t pos_dot = font_path.find_last_of('.');
std::string basename = font_path;
std::string ending = lowercase(font_path.substr(pos_dot));
std::string basename = font_path, ending;
if (pos_dot != std::string::npos)
ending = lowercase(font_path.substr(pos_dot));

if (ending == ".ttf") {
errorstream << "FontEngine: Found font \"" << font_path

0 comments on commit e15cae9

Please sign in to comment.