aboutsummaryrefslogtreecommitdiff
path: root/src/peaks.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/peaks.c')
-rw-r--r--src/peaks.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/peaks.c b/src/peaks.c
index 7466c880..b469d45a 100644
--- a/src/peaks.c
+++ b/src/peaks.c
@@ -286,6 +286,9 @@ static void integrate_peak(struct image *image, int xp, int yp,
/* Circular mask */
if ( x*x + y*y > lim ) continue;
+ if ( (x>=image->width) || (x<0) ) continue;
+ if ( (y>=image->height) || (y<0) ) continue;
+
val = image->data[(x+xp)+image->width*(y+yp)];
total += val;