diff options
author | Thomas White <taw@physics.org> | 2020-02-28 10:34:29 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-02-28 10:34:29 +0100 |
commit | 9560b439213a51898d0c018ffc3e1fdc8bcaddbd (patch) | |
tree | 3ea92df6595b1961ee77c255e057e58d6ccaa7c0 /libcrystfel | |
parent | 983512db08123fb6b12495890d9c7eabcaa57376 (diff) |
hdfile_get_value(): Check that ev->dim_length > 0 before looking in dim_entries
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/hdf5-file.c | 4 |
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); |