From 9f38730cf92fae322b6df8e5065b9c0ea7ca755a Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 9 Nov 2004 00:45:39 +0000 Subject: [PATCH] MFH: Fixed crash inside cpdf_setdash() if called before page init. --- ext/cpdf/cpdf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/cpdf/cpdf.c b/ext/cpdf/cpdf.c index 88655ff1d1..77072830b1 100644 --- a/ext/cpdf/cpdf.c +++ b/ext/cpdf/cpdf.c @@ -1563,7 +1563,9 @@ PHP_FUNCTION(cpdf_setdash) php_error(E_WARNING, "%s(): Unable to find identifier %d", get_active_function_name(TSRMLS_C), id); RETURN_FALSE; } - + if (!pdf->currentMemStream) { + RETURN_FALSE; + } snprintf(buffer, BUFFERLEN, "[%d %d] 0", (int) Z_LVAL_P(arg2), (int) Z_LVAL_P(arg3)); cpdf_setdash(pdf, buffer); -- 2.50.1