From 67a7449fc1f186f318942b9c6b8d66d4458b7d87 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 23 Apr 2018 10:15:36 +0100 Subject: Avoid SEGV when mudrawing to SVG. Belt and braces: 1) Don't attempt to close a NULL output stream. 2) If an output stream is NULL when we do close it, don't SEGV. --- source/fitz/output.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/fitz/output.c') diff --git a/source/fitz/output.c b/source/fitz/output.c index 4ee0023c..eafc5091 100644 --- a/source/fitz/output.c +++ b/source/fitz/output.c @@ -291,6 +291,8 @@ fz_new_output_with_buffer(fz_context *ctx, fz_buffer *buf) void fz_close_output(fz_context *ctx, fz_output *out) { + if (out == NULL) + return; fz_flush_output(ctx, out); if (out->close) out->close(ctx, out->state); -- cgit v1.2.3