aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-10-01 18:34:30 +0200
committerThomas White <taw@physics.org>2012-10-01 18:36:36 +0200
commitb9af6d806e147560aa943ce2c1f17034b2ddd462 (patch)
tree4e03b68528ea309475f91ddfc887fd7263cdb7e3
parente66759e2af3e761915fa02d842e9e00673452741 (diff)
Fix exit condition from integrate_peak()
This fixes a significant data quality regression introduced by f668e3b3 (21st June 2012)
-rw-r--r--libcrystfel/src/peaks.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c
index 418e7bde..8d488fea 100644
--- a/libcrystfel/src/peaks.c
+++ b/libcrystfel/src/peaks.c
@@ -330,10 +330,12 @@ static int integrate_peak(struct image *image, int cfs, int css,
if ( dfs*dfs + dss*dss > lim_sq ) continue;
/* Strayed off one panel? */
- if ( p_cfs+dfs >= p_w ) continue;
- if ( p_css+dss >= p_h ) continue;
- if ( p_cfs+dfs < 0 ) continue;
- if ( p_css+dss < 0 ) continue;
+ if ( (p_cfs+dfs >= p_w) || (p_css+dss >= p_h)
+ || (p_cfs+dfs < 0 ) || (p_css+dss < 0) )
+ {
+ free(bgPkMask);
+ return 1;
+ };
idx = dfs+cfs+image->width*(dss+css);