Skip to content

Commit

Permalink
Fixed a crash when text is added before a font is specified.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilia Alshanetsky committed Jul 2, 2003
1 parent 989500b commit 46d834a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ext/ming/ming.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit 46d834a

Please sign in to comment.