summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Hertzfeld <andy@src.gnome.org>2001-02-05 20:16:43 +0000
committerAndy Hertzfeld <andy@src.gnome.org>2001-02-05 20:16:43 +0000
commit1d10bfc8a08b70dbc5ef47ecb15e5654618a025d (patch)
treec79983bf0154de8fd08b0dcc0c9a703e8a643d98
parent466fc2dcd1705678a69248f775db11490385d22c (diff)
downloadnautilus-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--ChangeLog7
-rw-r--r--librsvg/rsvg.c7
2 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 4305cb145..547b0d8d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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,