aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2010-11-13 11:24:57 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:05 +0100
commit1307a104eb3b7ca62f1f4b00c48e55e9995b438f (patch)
tree85073154f40ae7800dd43532840d236883d41e9e /src
parent1f0da065385e1345f1201e6c1130adcc0bdcb6fe (diff)
render_hkl: Extra checking
Diffstat (limited to 'src')
-rw-r--r--src/render_hkl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/render_hkl.c b/src/render_hkl.c
index 4b077ba7..b7559cf5 100644
--- a/src/render_hkl.c
+++ b/src/render_hkl.c
@@ -314,12 +314,17 @@ static void render_za(UnitCell *cell, ReflItemList *items,
surface = cairo_pdf_surface_create(outfile, wh, ht);
if ( cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS ) {
- fprintf(stderr, "Couldn't create Cairo surface\n");
+ ERROR("Couldn't create Cairo surface\n");
cairo_surface_destroy(surface);
return;
}
dctx = cairo_create(surface);
+ if ( cairo_status(dctx) != CAIRO_STATUS_SUCCESS ) {
+ ERROR("Couldn't create Cairo context\n");
+ cairo_surface_destroy(surface);
+ return;
+ }
/* Black background */
cairo_rectangle(dctx, 0.0, 0.0, wh, ht);