summaryrefslogtreecommitdiff
path: root/pango/pangocairo-font.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-02-21 11:41:12 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-02-21 11:41:12 +0000
commit9d9369dc05e7df4558fc8ba36b7ec2dd969ae64f (patch)
tree8bef9728db416599b8160666c7e30a233d089d77 /pango/pangocairo-font.c
parente0babd9ed3f94843d2d8833592bd55895769c009 (diff)
downloadpango-9d9369dc05e7df4558fc8ba36b7ec2dd969ae64f.tar.gz
Bug 314239 – pangocairo crashes when font cannot be read
2006-02-21 Behdad Esfahbod <behdad@gnome.org> Bug 314239 – pangocairo crashes when font cannot be read * pango/pangocairo-fcfont.c, pango/pangocairo-font.c: Hack up to not crash if we cannot create cairo_scaled_font_t for PangoFont (font is not readable, removed, etc.)
Diffstat (limited to 'pango/pangocairo-font.c')
-rw-r--r--pango/pangocairo-font.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c
index 1e8112c4..cba260fd 100644
--- a/pango/pangocairo-font.c
+++ b/pango/pangocairo-font.c
@@ -146,6 +146,11 @@ _pango_cairo_font_get_hex_box_info (PangoCairoFont *cfont)
return hbi;
scaled_font = _pango_cairo_font_get_scaled_font (cfont);
+ if (!scaled_font)
+ {
+ g_object_set_data_full (G_OBJECT (cfont), "hex_box_info", NULL, NULL);
+ return NULL;
+ }
#ifdef HAVE_CAIRO_SCALED_FONT_GETTERS
/* prepare for some hinting */