summaryrefslogtreecommitdiff
path: root/ext/gd/libgd/gd.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/libgd/gd.c')
-rw-r--r--ext/gd/libgd/gd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c
index d73f0943af..2c63aac4cd 100644
--- a/ext/gd/libgd/gd.c
+++ b/ext/gd/libgd/gd.c
@@ -1774,9 +1774,13 @@ void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
if (x >= im->sx) {
x = im->sx - 1;
+ } else if (x < 0) {
+ x = 0;
}
if (y >= im->sy) {
y = im->sy - 1;
+ } else if (y < 0) {
+ y = 0;
}
for (i = x; i >= 0; i--) {