Skip to content

Commit 088a6ad

Browse files
committed
- Fix #53492, fix crash if aa steps are invalid
1 parent 27ecaa7 commit 088a6ad

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ext/gd/gd.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4290,6 +4290,11 @@ PHP_FUNCTION(imagepstext)
42904290
return;
42914291
}
42924292

4293+
if (aa_steps != 4 || aa_steps != 16) {
4294+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "AA steps must be 4 or 16");
4295+
RETURN_FALSE;
4296+
}
4297+
42934298
ZEND_FETCH_RESOURCE(bg_img, gdImagePtr, &img, -1, "Image", le_gd);
42944299
ZEND_FETCH_RESOURCE(f_ind, int *, &fnt, -1, "Type 1 font", le_ps_font);
42954300

0 commit comments

Comments
 (0)