summaryrefslogtreecommitdiff
path: root/source/fitz/document.c
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2016-03-15 16:33:22 -0700
committerRobin Watts <robin.watts@artifex.com>2016-04-19 18:30:40 +0100
commit1bbde93ba39613877ded2015965aaab2341d3d36 (patch)
treef2a4936de895c6ddc40deb7bc93ccfb66de514d3 /source/fitz/document.c
parent335798189cbd40cd518ce49d1fa4c7eaa2811977 (diff)
downloadmupdf-1bbde93ba39613877ded2015965aaab2341d3d36.tar.xz
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.
Diffstat (limited to 'source/fitz/document.c')
-rw-r--r--source/fitz/document.c3
1 files changed, 2 insertions, 1 deletions
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;
}