From 23f4f495a5f91414c633ccc27a137901d61b923f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 6 May 2006 21:48:02 +0000 Subject: [PATCH] pango_font_description_get_family() can return NULL git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39084 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/unix/fontutil.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index 3081336057..7ca376fb91 100644 --- a/src/unix/fontutil.cpp +++ b/src/unix/fontutil.cpp @@ -140,7 +140,10 @@ wxFontFamily wxNativeFontInfo::GetFamily() const // around a bug in the 64-bit glib shipped with solaris 10, -1 causes it // to try to allocate 2^32 bytes. const char *family_name = pango_font_description_get_family( description ); - char *family_text = g_ascii_strdown( family_name, family_name ? strlen( family_name ) : 0 ); + if ( !family_name ) + return ret; + + char *family_text = g_ascii_strdown( family_name, strlen( family_name ) ); // Check for some common fonts, to salvage what we can from the current win32 centric wxFont API: if (strncmp( family_text, "monospace", 9 ) == 0) ret = wxFONTFAMILY_TELETYPE; // begins with "Monospace"