summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/cpdf/cpdf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/cpdf/cpdf.c b/ext/cpdf/cpdf.c
index 4c872d7cbd..594f1ca6f7 100644
--- a/ext/cpdf/cpdf.c
+++ b/ext/cpdf/cpdf.c
@@ -1286,6 +1286,10 @@ PHP_FUNCTION(cpdf_setdash)
convert_to_long_ex(arg2);
convert_to_long_ex(arg3);
+ if (!pdf->currentMemStream) {
+ RETURN_FALSE;
+ }
+
snprintf(buffer, BUFFERLEN, "[%d %d] 0", (int) Z_LVAL_PP(arg2), (int) Z_LVAL_PP(arg3));
cpdf_setdash(pdf, buffer);