diff options
author | Thomas White <taw@physics.org> | 2020-02-27 13:50:25 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-07-29 18:42:24 +0200 |
commit | 90015d5037d76336dc7713de9bd5be0f786eda7d (patch) | |
tree | 960d8baa5c31dc60e1bd88aea17b10be374451d7 /libcrystfel | |
parent | 300f09607bb06bbbac1ffbeb2ad2e6985459abd1 (diff) |
image_read_hdf5(): Allocate bad maps
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/image.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c index 41fc064b..8c4ba3fc 100644 --- a/libcrystfel/src/image.c +++ b/libcrystfel/src/image.c @@ -1427,13 +1427,18 @@ static struct image *image_read_hdf5(DataTemplate *dtempl, const char *filename, image->dp[pi] = malloc(dims[0]*dims[1]*sizeof(float)); image->sat[pi] = malloc(dims[0]*dims[1]*sizeof(float)); - if ( (image->dp[pi] == NULL) || (image->sat[pi] == NULL) ) { + image->bad[pi] = calloc(dims[0]*dims[1], sizeof(int)); + if ( (image->dp[pi] == NULL) + || (image->sat[pi] == NULL) + || (image->bad[pi] == NULL) ) + { ERROR("Failed to allocate panel %s\n", p->name); free(f_offset); free(f_count); for ( i=0; i<=pi; i++ ) { free(image->dp[i]); free(image->sat[i]); + free(image->bad[i]); } free(image->dp); free(image->bad); |