From 0f5fc3a4fdeac81c78793600fe6efb433d44509d Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 30 May 2013 20:36:20 +0200 Subject: Fix uninitialised saturation flag --- libcrystfel/src/integration.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libcrystfel/src/integration.c') diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c index 9028711a..10e2b8a8 100644 --- a/libcrystfel/src/integration.c +++ b/libcrystfel/src/integration.c @@ -793,6 +793,8 @@ static int check_box(struct intcontext *ic, struct peak_box *bx, int *sat) double cdx, cdy, cdz; signed int hr, kr, lr; + if ( sat != NULL ) *sat = 0; + bx->bm = malloc(ic->w*ic->w*sizeof(int)); if ( bx->bm == NULL ) return 1; @@ -829,7 +831,7 @@ static int check_box(struct intcontext *ic, struct peak_box *bx, int *sat) if ( (bx->bm[p+ic->w*q] != BM_IG) && (bx->bm[p+ic->w*q] != BM_BH) && (boxi(ic, bx, p, q) > bx->p->max_adu) ) { - *sat = 1; + if ( sat != NULL ) *sat = 1; } /* Ignore if this pixel is closer to the next reciprocal lattice -- cgit v1.2.3