]> granicus.if.org Git - php/commitdiff
Fixed a crash when text is added before a font is specified.
authorIlia Alshanetsky <iliaa@php.net>
Wed, 2 Jul 2003 02:04:00 +0000 (02:04 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 2 Jul 2003 02:04:00 +0000 (02:04 +0000)
ext/ming/ming.c

index 2e1be95d181d7b5a69b89b6b697760431e75395c..b69ffaf4e46e3b4a5ad14cd0c282ab2f3c1c488d 100644 (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);
 }