Code

fix some crashes. Now I check for the existence of the d atrtibute
authorJucaBlues <JucaBlues@users.sourceforge.net>
Thu, 29 May 2008 03:57:52 +0000 (03:57 +0000)
committerJucaBlues <JucaBlues@users.sourceforge.net>
Thu, 29 May 2008 03:57:52 +0000 (03:57 +0000)
before trying to use it

src/display/nr-svgfonts.cpp

index 9b760c0bc97a7b4ccf7cf0cc775d00b646535424..ccce7edc597c30fa58bd814ee6053b8bffe86305 100644 (file)
@@ -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);