summaryrefslogtreecommitdiff
path: root/source/tools/pdfposter.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2016-04-18 13:00:24 +0200
committerRobin Watts <robin.watts@artifex.com>2016-04-22 17:26:48 +0100
commitf9f144849ca9611dd46e6cbb27b9f1100371e455 (patch)
treec2bc1b4be466822d624dbecdc8668c593c6cef90 /source/tools/pdfposter.c
parentf88bfe2e62dbadb96d4f52d7aa025f0a516078da (diff)
downloadmupdf-f9f144849ca9611dd46e6cbb27b9f1100371e455.tar.xz
pdf: Remember to drop objects inserted into dicts.
Diffstat (limited to 'source/tools/pdfposter.c')
-rw-r--r--source/tools/pdfposter.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/tools/pdfposter.c b/source/tools/pdfposter.c
index 0393f137..92735386 100644
--- a/source/tools/pdfposter.c
+++ b/source/tools/pdfposter.c
@@ -46,7 +46,7 @@ intersect_box(fz_context *ctx, pdf_document *doc, pdf_obj *page, pdf_obj *box_na
pdf_array_push(ctx, newbox, pdf_new_real(ctx, doc, old_rect.y0));
pdf_array_push(ctx, newbox, pdf_new_real(ctx, doc, old_rect.x1));
pdf_array_push(ctx, newbox, pdf_new_real(ctx, doc, old_rect.y1));
- pdf_dict_put(ctx, page, box_name, newbox);
+ pdf_dict_put_drop(ctx, page, box_name, newbox);
}
/*
@@ -128,7 +128,7 @@ static void decimatepages(fz_context *ctx, pdf_document *doc)
pdf_array_push(ctx, newmediabox, pdf_new_real(ctx, doc, mb.y1));
pdf_dict_put(ctx, newpageobj, PDF_NAME_Parent, parent);
- pdf_dict_put(ctx, newpageobj, PDF_NAME_MediaBox, newmediabox);
+ pdf_dict_put_drop(ctx, newpageobj, PDF_NAME_MediaBox, newmediabox);
intersect_box(ctx, doc, newpageobj, PDF_NAME_CropBox, &mb);
intersect_box(ctx, doc, newpageobj, PDF_NAME_BleedBox, &mb);
@@ -146,9 +146,8 @@ static void decimatepages(fz_context *ctx, pdf_document *doc)
pdf_drop_obj(ctx, parent);
/* Update page count and kids array */
- pdf_dict_put(ctx, pages, PDF_NAME_Count, pdf_new_int(ctx, doc, kidcount));
- pdf_dict_put(ctx, pages, PDF_NAME_Kids, kids);
- pdf_drop_obj(ctx, kids);
+ pdf_dict_put_drop(ctx, pages, PDF_NAME_Count, pdf_new_int(ctx, doc, kidcount));
+ pdf_dict_put_drop(ctx, pages, PDF_NAME_Kids, kids);
}
int pdfposter_main(int argc, char **argv)