From 5cbf45b25928ae2b8fc8ba29b413e01a24721039 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 5 Feb 2018 12:27:30 +0100 Subject: Add 'null' output device so we can remove NULL checks in hot functions. --- source/tools/mudraw.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/tools') 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); } -- cgit v1.2.3