aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-11-01 11:05:23 +0100
committerThomas White <taw@physics.org>2018-11-02 14:24:55 +0100
commitb332d88b810f876034ee9879b0d3741a7c46a8b5 (patch)
tree27fbb4145de763954d70731196ff9cfe8cb0c743 /libcrystfel
parent02675d2a6e77c58cefec4b9fb49332824bfb8ea1 (diff)
Fix possibly uninitialised dataf in read_cbf_data()
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/image.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c
index cbefae4f..26d48007 100644
--- a/libcrystfel/src/image.c
+++ b/libcrystfel/src/image.c
@@ -767,10 +767,15 @@ static float *read_cbf_data(struct imagefile *f, int *w, int *h, cbf_handle *pcb
if ( elsize == 4 ) {
dataf = convert_sint32_float(data, dimfast, dimmid);
- }
- if ( elsize == 2 ) {
+ } else if ( elsize == 2 ) {
dataf = convert_sint16_float(data, dimfast, dimmid);
+ } else {
+ ERROR("Don't know how to convert element size %i\n",
+ (int)elsize);
+ cbf_free_handle(cbfh);
+ return NULL;
}
+
free(data);
free(buf); /* Might be NULL */