diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-02-05 12:27:30 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-02-08 13:22:51 +0100 |
commit | 5cbf45b25928ae2b8fc8ba29b413e01a24721039 (patch) | |
tree | 54dff8bd8f7533e212ab355abfc3848cc69a66ec /source/tools | |
parent | 4e30159ad7ffd59c0a15f421c3b49842badeb74d (diff) | |
download | mupdf-5cbf45b25928ae2b8fc8ba29b413e01a24721039.tar.xz |
Add 'null' output device so we can remove NULL checks in hot functions.
Diffstat (limited to 'source/tools')
-rw-r--r-- | source/tools/mudraw.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/tools/mudraw.c b/source/tools/mudraw.c index 59a0923a..883bbb37 100644 --- a/source/tools/mudraw.c +++ b/source/tools/mudraw.c @@ -1143,8 +1143,11 @@ static void drawpage(fz_context *ctx, fz_document *doc, int pagenum) char text_buffer[512]; bgprint_flush(); - fz_close_output(ctx, out); - fz_drop_output(ctx, out); + if (out) + { + fz_close_output(ctx, out); + fz_drop_output(ctx, out); + } fz_snprintf(text_buffer, sizeof(text_buffer), output, pagenum); out = fz_new_output_with_path(ctx, text_buffer, 0); } |