aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-02-28 10:34:29 +0100
committerThomas White <taw@physics.org>2020-02-28 10:34:29 +0100
commit9560b439213a51898d0c018ffc3e1fdc8bcaddbd (patch)
tree3ea92df6595b1961ee77c255e057e58d6ccaa7c0
parent983512db08123fb6b12495890d9c7eabcaa57376 (diff)
hdfile_get_value(): Check that ev->dim_length > 0 before looking in dim_entries
-rw-r--r--libcrystfel/src/hdf5-file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libcrystfel/src/hdf5-file.c b/libcrystfel/src/hdf5-file.c
index d6f25729..a7430fb2 100644
--- a/libcrystfel/src/hdf5-file.c
+++ b/libcrystfel/src/hdf5-file.c
@@ -1236,7 +1236,9 @@ int hdfile_get_value(struct hdfile *f, const char *name, struct event *ev,
for ( i=0; i<ndims; i++ ) {
if ( size[i] == 1 ) continue;
- if ( ( i==0 ) && (ev != NULL) && (size[i] > ev->dim_entries[0]) ) {
+ if ( ( i==0 ) && (ev != NULL) && (ev->dim_length > 0)
+ && (size[i] > ev->dim_entries[0]) )
+ {
dim_flag = 1;
} else {
H5Tclose(type);