From 9560b439213a51898d0c018ffc3e1fdc8bcaddbd Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 28 Feb 2020 10:34:29 +0100 Subject: hdfile_get_value(): Check that ev->dim_length > 0 before looking in dim_entries --- libcrystfel/src/hdf5-file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 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); -- cgit v1.2.3