mirror of
https://github.com/php/php-src.git
synced 2025-08-21 01:45:16 +02:00
Fixed a crash when text is added before a font is specified.
This commit is contained in:
parent
989500b347
commit
46d834aad2
1 changed files with 5 additions and 0 deletions
|
@ -2386,6 +2386,11 @@ PHP_FUNCTION(swftext_addString)
|
|||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &s) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
if (!getFont(getText(getThis() TSRMLS_CC))) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must specify a font before writing text.");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
convert_to_string_ex(s);
|
||||
SWFText_addString(text, Z_STRVAL_PP(s), NULL);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue