From 3df8a0d8c228810d4f63e342fe67642585d84154 Mon Sep 17 00:00:00 2001 From: rxi Date: Mon, 26 Sep 2016 21:00:37 +0100 Subject: [PATCH] Fixed bounds check in image_setPixel/setMaskPixel --- src/image.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/image.h b/src/image.h index f0c34cf..9546fde 100644 --- a/src/image.h +++ b/src/image.h @@ -30,14 +30,14 @@ typedef struct { static inline void image_setPixel(image_t* self, int x, int y, pixel_t val) { - if (x > 0 && x < self->width && y > 0 && y < self->height) { + if (x >= 0 && x < self->width && y >= 0 && y < self->height) { self->data[x + y * self->width] = val; } } static inline void image_setMaskPixel(image_t* self, int x, int y, pixel_t val) { - if (x > 0 && x < self->width && y > 0 && y < self->height) { + if (x >= 0 && x < self->width && y >= 0 && y < self->height) { self->mask[x + y * self->width] = val; } }