summaryrefslogtreecommitdiff
path: root/ext/gd/gd.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/gd.c')
-rw-r--r--ext/gd/gd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 7eae7a52d2..238852286c 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -3427,7 +3427,10 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have at least 3 points in your array");
RETURN_FALSE;
}
-
+ if (npoints <= 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must give a positive number of points");
+ RETURN_FALSE;
+ }
if (nelem < npoints * 2) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to use %d points in array with only %d points", npoints, nelem/2);
RETURN_FALSE;