summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-clean.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/pdf/pdf-clean.c')
-rw-r--r--source/pdf/pdf-clean.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/pdf/pdf-clean.c b/source/pdf/pdf-clean.c
index 3d34c1a1..8e1dc894 100644
--- a/source/pdf/pdf-clean.c
+++ b/source/pdf/pdf-clean.c
@@ -162,7 +162,8 @@ void pdf_clean_page_contents(fz_context *ctx, pdf_document *doc, pdf_page *page,
/* create a new object to replace the array */
new_obj = pdf_new_dict(ctx, doc, 1);
new_ref = pdf_new_ref(ctx, doc, new_obj);
- page->contents = contents = new_ref;
+ pdf_drop_obj(ctx, page->contents);
+ page->contents = contents = pdf_keep_obj(ctx, new_ref);
}
else
{