From: Pierre Joye Date: Wed, 8 Dec 2010 08:45:56 +0000 (+0000) Subject: - Fix #53492, fix crash if aa steps are invalid X-Git-Tag: php-5.4.0alpha1~191^2~552 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=088a6ad7b5ab5ea04af356ca8f6bb3183455eb66;p=php - Fix #53492, fix crash if aa steps are invalid --- diff --git a/ext/gd/gd.c b/ext/gd/gd.c index f56299977e..8c7e6b1164 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -4290,6 +4290,11 @@ PHP_FUNCTION(imagepstext) return; } + if (aa_steps != 4 || aa_steps != 16) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "AA 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);