summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2009-01-31 23:35:48 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2009-01-31 23:35:48 +0000
commit444a53fb2607c6bd59c644f080843fc0ead5555a (patch)
tree70b77adee557a4ad786f626c77b0b48748537237 /pango
parentc9cf909e722a3750b4dcaea19780d5f6fe65e22a (diff)
downloadpango-444a53fb2607c6bd59c644f080843fc0ead5555a.tar.gz
It's not a programming error if face->family is NULL or family->fontmap is
2009-01-31 Behdad Esfahbod <behdad@gnome.org> * pango/pangofc-fontmap.c (pango_fc_face_describe), (pango_fc_face_list_sizes), (pango_fc_family_list_faces): It's not a programming error if face->family is NULL or family->fontmap is NULL. Be graceful. svn path=/trunk/; revision=2823
Diffstat (limited to 'pango')
-rw-r--r--pango/pangofc-fontmap.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 11cb6762..491b912c 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -2050,7 +2050,8 @@ pango_fc_face_describe (PangoFontFace *face)
FcPattern *match_pattern;
FcPattern *result_pattern;
- g_return_val_if_fail (fcfamily != NULL, NULL);
+ if (G_UNLIKELY (!fcfamily))
+ return pango_font_description_new ();
if (fcface->fake)
{
@@ -2121,8 +2122,8 @@ pango_fc_face_list_sizes (PangoFontFace *face,
*sizes = NULL;
*n_sizes = 0;
- g_return_if_fail (fcface->family != NULL);
- g_return_if_fail (fcface->family->fontmap != NULL);
+ if (G_UNLIKELY (!fcface->family || !fcface->family->fontmap))
+ return;
pattern = FcPatternCreate ();
FcPatternAddString (pattern, FC_FAMILY, (FcChar8*)(void*)fcface->family->family_name);
@@ -2255,7 +2256,8 @@ pango_fc_family_list_faces (PangoFontFamily *family,
*faces = NULL;
*n_faces = 0;
- g_return_if_fail (fcfontmap != NULL);
+ if (G_UNLIKELY (!fcfontmap))
+ return;
priv = fcfontmap->priv;