summaryrefslogtreecommitdiff
path: root/apps/pdfshow.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2009-07-02 20:05:01 +0200
committerTor Andersson <tor@ghostscript.com>2009-07-02 20:05:01 +0200
commitaeb450a0b00e0996f6f6e0f4e160c4ed0b595d90 (patch)
tree4bf017762ec77893e462044ce4e199e0a88f6568 /apps/pdfshow.c
parentb23997bb49eb5ee3d7813fb993d42c1be043af74 (diff)
downloadmupdf-aeb450a0b00e0996f6f6e0f4e160c4ed0b595d90.tar.xz
Increment reference count of catalog and info objects when opening a pdf.
Diffstat (limited to 'apps/pdfshow.c')
-rw-r--r--apps/pdfshow.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/pdfshow.c b/apps/pdfshow.c
index 981d5b4b..994a885c 100644
--- a/apps/pdfshow.c
+++ b/apps/pdfshow.c
@@ -45,9 +45,13 @@ void openxref(char *filename, char *password)
/* TODO: move into mupdf lib, see pdfapp_open in pdfapp.c */
obj = fz_dictgets(xref->trailer, "Root");
xref->root = fz_resolveindirect(obj);
+ if (xref->root)
+ fz_keepobj(xref->root);
obj = fz_dictgets(xref->trailer, "Info");
xref->info = fz_resolveindirect(obj);
+ if (xref->info)
+ fz_keepobj(xref->info);
}
void closexref()