From 1bbde93ba39613877ded2015965aaab2341d3d36 Mon Sep 17 00:00:00 2001 From: Michael Vrhel Date: Tue, 15 Mar 2016 16:33:22 -0700 Subject: Add mutool merge This commit adds a page merging tool. The tool demonstrates the use of object grafting. The object grafting function recursively goes through the object to add all referenced objects. A map is maintained to ensure that objects that have already been copied are not copied again. --- source/fitz/document.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/fitz/document.c') diff --git a/source/fitz/document.c b/source/fitz/document.c index 1719aaf6..7041616b 100644 --- a/source/fitz/document.c +++ b/source/fitz/document.c @@ -157,7 +157,8 @@ fz_new_document(fz_context *ctx, int size) fz_document * fz_keep_document(fz_context *ctx, fz_document *doc) { - ++doc->refs; + if (doc) + ++doc->refs; return doc; } -- cgit v1.2.3