From 037b419546bb947b927a95d1365e3ef9a82c4310 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 16 Jun 2021 14:48:04 +0200 Subject: stream_read_chunk: Bail out if detgeom can't be created --- libcrystfel/src/stream.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c index 68643a17..33f1b4a8 100644 --- a/libcrystfel/src/stream.c +++ b/libcrystfel/src/stream.c @@ -1080,7 +1080,10 @@ struct image *stream_read_chunk(Stream *st, StreamFlags srf) if ( have_filename && have_ev ) { /* Success */ if ( srf & STREAM_DATA_DETGEOM ) { - create_detgeom(image, st->dtempl_read); + if ( create_detgeom(image, st->dtempl_read) ) { + image_free(image); + return NULL; + } image_set_zero_data(image, st->dtempl_read); image_set_zero_mask(image, st->dtempl_read); } -- cgit v1.2.3