diff options
author | Thomas White <taw@physics.org> | 2013-05-30 20:36:20 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2013-05-30 20:36:20 +0200 |
commit | 0f5fc3a4fdeac81c78793600fe6efb433d44509d (patch) | |
tree | 7530d0294414039556cadadfe5273c9625944d80 /libcrystfel/src/integration.c | |
parent | 8395530d4eeaaf4d2a0aeff35b5ddcfd90728cb5 (diff) |
Fix uninitialised saturation flag
Diffstat (limited to 'libcrystfel/src/integration.c')
-rw-r--r-- | libcrystfel/src/integration.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 |