aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-04-03 15:57:02 +0200
committerThomas White <taw@physics.org>2019-04-03 15:57:02 +0200
commitc1b4861ace94179055e8ea746e631a15bc6b4364 (patch)
treea667c08a95a65179d449fe0c9a23bc623dd6f10c
parent0a1a129583fdd191045df501d22a0342f612e548 (diff)
hdfsee: Fix crash with no geometry file
-rw-r--r--libcrystfel/src/detector.c2
-rw-r--r--src/dw-hdfsee.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c
index 75d5bdb9..8c2f3828 100644
--- a/libcrystfel/src/detector.c
+++ b/libcrystfel/src/detector.c
@@ -1740,6 +1740,8 @@ struct detector *copy_geom(const struct detector *in)
struct detector *out;
int i;
+ if ( in == NULL ) return NULL;
+
out = malloc(sizeof(struct detector));
memcpy(out, in, sizeof(struct detector));
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c
index ef576394..a4ba6e8a 100644
--- a/src/dw-hdfsee.c
+++ b/src/dw-hdfsee.c
@@ -3019,7 +3019,8 @@ DisplayWindow *displaywindow_open(char *filename, char *geom_filename,
dw->multi_event = 0;
}
- if ( multi_event_geometry(dw->image->det) )
+ if ( (dw->image->det != NULL)
+ && (multi_event_geometry(dw->image->det)) )
{
struct hdfile *hdfile;