From 80769a368b75a7126440c3a5c2a4d858268d8beb Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Thu, 29 May 2008 03:57:52 +0000 Subject: fix some crashes. Now I check for the existence of the d atrtibute before trying to use it (bzr r5761) --- src/display/nr-svgfonts.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/display/nr-svgfonts.cpp b/src/display/nr-svgfonts.cpp index 9b760c0bc..ccce7edc5 100644 --- a/src/display/nr-svgfonts.cpp +++ b/src/display/nr-svgfonts.cpp @@ -155,8 +155,10 @@ SvgFont::scaled_font_render_glyph (cairo_scaled_font_t *scaled_font, } NArtBpath *bpath = NULL; - if (SP_IS_GLYPH(node)) bpath = sp_svg_read_path(((SPGlyph*)node)->d); - if (SP_IS_MISSING_GLYPH(node)) bpath = sp_svg_read_path(((SPMissingGlyph*)node)->d); + if (SP_IS_GLYPH(node) && ((SPGlyph*)node)->d) bpath = sp_svg_read_path(((SPGlyph*)node)->d); + if (SP_IS_MISSING_GLYPH(node) && ((SPMissingGlyph*)node)->d) bpath = sp_svg_read_path(((SPMissingGlyph*)node)->d); + + if (!bpath) return CAIRO_STATUS_SUCCESS; cairo_new_path(cr); -- cgit v1.2.3