summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-27 00:01:38 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-27 00:21:57 -0300
commitd3b08bcf7e47fc7cb84772707d476ddf9769a108 (patch)
tree04f64a05de164fe152a63ee1ea95b85925c82ea9
parentd104b7518b9621f9547a3ca37bb87366a4e27fc4 (diff)
downloadeeshow-d3b08bcf7e47fc7cb84772707d476ddf9769a108.tar.gz
eeshow-d3b08bcf7e47fc7cb84772707d476ddf9769a108.tar.bz2
eeshow-d3b08bcf7e47fc7cb84772707d476ddf9769a108.zip
gfx/cro.c (cro_img_write): check cairo_surface_write_to_png return value
-rw-r--r--gfx/cro.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gfx/cro.c b/gfx/cro.c
index 1547759..88a4659 100644
--- a/gfx/cro.c
+++ b/gfx/cro.c
@@ -751,10 +751,15 @@ uint32_t *cro_img_end(struct cro_ctx *cc, int *w, int *h, int *stride)
void cro_img_write(cairo_surface_t *s, const char *name)
{
+ cairo_status_t status;
+
if (name)
- cairo_surface_write_to_png(s, name);
+ status = cairo_surface_write_to_png(s, name);
else
- cairo_surface_write_to_png_stream(s, stream_to_stdout, NULL);
+ status = cairo_surface_write_to_png_stream(s, stream_to_stdout,
+ NULL);
+ if (status != CAIRO_STATUS_SUCCESS)
+ fatal("%s: %s", name, cairo_status_to_string(status));
}