From: johanengelen Date: Fri, 28 Dec 2007 16:32:23 +0000 (+0000) Subject: try to fix bug #174475 feImage renderer crashes on non-external image X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5ac1506f110d85fc58af1b32a2c9c60e30f67552;p=inkscape.git try to fix bug #174475 feImage renderer crashes on non-external image --- diff --git a/src/display/nr-filter-image.cpp b/src/display/nr-filter-image.cpp index 312e85404..2d32cc51a 100644 --- a/src/display/nr-filter-image.cpp +++ b/src/display/nr-filter-image.cpp @@ -35,11 +35,25 @@ int FilterImage::render(FilterSlot &slot, FilterUnits const &/*units*/) { if (!feImageHref) return 0; if (!image_pixbuf){ - if ( (image = Gdk::Pixbuf::create_from_file(feImageHref)) < 0 ) return 0; - width = image->get_width(); - height = image->get_height(); - rowstride = image->get_rowstride(); - image_pixbuf = image->get_pixels(); + try { + image = Gdk::Pixbuf::create_from_file(feImageHref); + } + catch (const Glib::FileError & e) + { + g_warning("caught Glib::FileError in FilterImage::render"); + return 0; + } + catch (const Gdk::PixbufError & e) + { + g_warning("Gdk::PixbufError in FilterImage::render"); + return 0; + } + if ( !image ) return 0; + + width = image->get_width(); + height = image->get_height(); + rowstride = image->get_rowstride(); + image_pixbuf = image->get_pixels(); } int w,x,y; NRPixBlock *in = slot.get(_input);