aboutsummaryrefslogtreecommitdiff
path: root/src/peaks.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-01-25 16:56:00 +0100
committerThomas White <taw@physics.org>2010-01-25 16:56:00 +0100
commit8c27cf75adef7381dc5517cf3225d00e0bf8f10f (patch)
tree205417e88282cdc36d8bdb8441e0607ca07a4351 /src/peaks.c
parent862addd0efd780d648ddefbaf2c73f1701ff683b (diff)
Fix the obvious overrun
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;