From 8c27cf75adef7381dc5517cf3225d00e0bf8f10f Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 25 Jan 2010 16:56:00 +0100 Subject: Fix the obvious overrun --- src/peaks.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- cgit v1.2.3