diff options
author | Andy Hertzfeld <andy@src.gnome.org> | 2001-02-05 20:16:43 +0000 |
---|---|---|
committer | Andy Hertzfeld <andy@src.gnome.org> | 2001-02-05 20:16:43 +0000 |
commit | 1d10bfc8a08b70dbc5ef47ecb15e5654618a025d (patch) | |
tree | c79983bf0154de8fd08b0dcc0c9a703e8a643d98 | |
parent | 466fc2dcd1705678a69248f775db11490385d22c (diff) | |
download | nautilus-1d10bfc8a08b70dbc5ef47ecb15e5654618a025d.tar.gz |
fixed bug 6301, bad svg crashes Nautilus, by adding a check in
* librsvg/rsvg.c: (rsvg_render_svp):
fixed bug 6301, bad svg crashes Nautilus, by adding a check
in rsvg_render_svp to make sure a pixbuf has been allocated; if
not, don't try to render.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | librsvg/rsvg.c | 7 |
2 files changed, 14 insertions, 0 deletions
@@ -1,3 +1,10 @@ +2001-02-05 Andy Hertzfeld <andy@eazel.com> + + * librsvg/rsvg.c: (rsvg_render_svp): + fixed bug 6301, bad svg crashes Nautilus, by adding a check + in rsvg_render_svp to make sure a pixbuf has been allocated; if + not, don't try to render. + 2001-02-05 John Sullivan <sullivan@eazel.com> Fixed bug 6321 (Apparently arbitrary item initially selected diff --git a/librsvg/rsvg.c b/librsvg/rsvg.c index 3cd3aeddd..b3ff94f92 100644 --- a/librsvg/rsvg.c +++ b/librsvg/rsvg.c @@ -752,6 +752,13 @@ rsvg_render_svp (RsvgCtx *ctx, const ArtSVP *svp, gboolean has_alpha; pixbuf = ctx->pixbuf; + /* if a pixbuf hasn't been allocated, the svg is probably misformed. Exit + * to avoid crashing. + */ + if (pixbuf == NULL) { + return; + } + has_alpha = gdk_pixbuf_get_has_alpha (pixbuf); render = art_render_new (0, 0, |