Fixed a crash when text is added before a font is specified.

This commit is contained in:
Ilia Alshanetsky 2003-07-02 02:04:00 +00:00
parent 989500b347
commit 46d834aad2

View file

@ -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);
}