diff options
author | Robin Watts <robin.watts@artifex.com> | 2018-04-23 10:15:36 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2018-04-23 10:16:57 +0100 |
commit | 67a7449fc1f186f318942b9c6b8d66d4458b7d87 (patch) | |
tree | 1681c065c423b2555655af68a2bfbe4d73c99b71 /source/fitz | |
parent | db4e21fea6c156f8b2b710937cbee1e7e8d7b7c2 (diff) | |
download | mupdf-67a7449fc1f186f318942b9c6b8d66d4458b7d87.tar.xz |
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.
Diffstat (limited to 'source/fitz')
-rw-r--r-- | source/fitz/output.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |