diff options
author | Thomas White <taw@physics.org> | 2010-01-25 16:56:00 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2010-01-25 16:56:00 +0100 |
commit | 8c27cf75adef7381dc5517cf3225d00e0bf8f10f (patch) | |
tree | 205417e88282cdc36d8bdb8441e0607ca07a4351 | |
parent | 862addd0efd780d648ddefbaf2c73f1701ff683b (diff) |
Fix the obvious overrun
-rw-r--r-- | src/peaks.c | 3 |
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; |