aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/intensities.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/intensities.c b/src/intensities.c
index c70e63f7..ae8667cb 100644
--- a/src/intensities.c
+++ b/src/intensities.c
@@ -127,6 +127,13 @@ void output_intensities(struct image *image)
for ( i=0; i<n_hits; i++ ) {
int intensity;
+
+ /* Bounds check */
+ if ( hits[i].x + 3 >= image->width ) continue;
+ if ( hits[i].x - 3 < 0 ) continue;
+ if ( hits[i].y + 3 >= image->height ) continue;
+ if ( hits[i].y - 3 < 0 ) continue;
+
intensity = sum_nearby_points(image->data, image->width,
hits[i].x, hits[i].y);