aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/hdf5-file.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-03-01 14:07:54 +0100
committerThomas White <taw@physics.org>2019-03-01 14:08:28 +0100
commitb5f0141aa339b3af4761f155ccd05308b6db05b5 (patch)
tree2373e3f0aece18dff62d1d37bdb50391cddb295c /libcrystfel/src/hdf5-file.c
parentaa7ca6edfe2203692aced574294d03f51dcd1feb (diff)
Don't mask out entire image if bad pixel map can't be loaded
Diffstat (limited to 'libcrystfel/src/hdf5-file.c')
-rw-r--r--libcrystfel/src/hdf5-file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libcrystfel/src/hdf5-file.c b/libcrystfel/src/hdf5-file.c
index 3d9ea0b2..9c8038ea 100644
--- a/libcrystfel/src/hdf5-file.c
+++ b/libcrystfel/src/hdf5-file.c
@@ -1901,8 +1901,11 @@ int hdf5_read2(struct hdfile *f, struct image *image, struct event *ev,
if ( p->mask != NULL ) {
int *flags = malloc(p->w*p->h*sizeof(int));
- load_mask(f, ev, p, flags, f_offset, f_count, hsd);
- image->bad[pi] = make_badmask(flags, p, image->det);
+ if ( !load_mask(f, ev, p, flags, f_offset, f_count, hsd) ) {
+ image->bad[pi] = make_badmask(flags, p, image->det);
+ } else {
+ image->bad[pi] = make_badmask(NULL, p, image->det);
+ }
free(flags);
} else {
image->bad[pi] = make_badmask(NULL, p, image->det);