diff --git a/src/training/pango/pango_font_info.cpp b/src/training/pango/pango_font_info.cpp index 7cf1f696..86771b58 100644 --- a/src/training/pango/pango_font_info.cpp +++ b/src/training/pango/pango_font_info.cpp @@ -317,6 +317,8 @@ bool PangoFontInfo::GetSpacingProperties(const std::string& utf8_char, int* x_bearing, int* x_advance) const { // Convert to equivalent PangoFont structure PangoFont* font = ToPangoFont(); + if (!font) + return false; // Find the glyph index in the font for the supplied utf8 character. int total_advance = 0; int min_bearing = 0;