--- php-5.2.14.orig/ext/gd/gd.c	2011-01-26 12:38:42.956023043 +0200
+++ php-5.2.14/ext/gd/gd.c	2011-01-26 13:37:21.171023045 +0200
@@ -4593,6 +4593,11 @@
 		return;
 	}
 
+    if (aa_steps != 4 && aa_steps != 16) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Antialias steps must be 4 or 16");
+        RETURN_FALSE;
+    }
+
 	ZEND_FETCH_RESOURCE(bg_img, gdImagePtr, &img, -1, "Image", le_gd);
 	ZEND_FETCH_RESOURCE(f_ind, int *, &fnt, -1, "Type 1 font", le_ps_font);
 
