diff options
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/peaks.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c index 8d488fea..973dd523 100644 --- a/libcrystfel/src/peaks.c +++ b/libcrystfel/src/peaks.c @@ -263,10 +263,12 @@ static int integrate_peak(struct image *image, int cfs, int css, if ( dfs*dfs + dss*dss < mid_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; + }; /* Check if there is a peak in the background region */ if ( bgPkMask[(p_cfs+dfs) + p_w*(p_css+dss)] ) continue; |