summaryrefslogtreecommitdiff
path: root/librsvg/rsvg.c
diff options
context:
space:
mode:
Diffstat (limited to 'librsvg/rsvg.c')
-rw-r--r--librsvg/rsvg.c7
1 files changed, 7 insertions, 0 deletions
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,