diff options
author | Simon Reinhardt <simon.reinhardt@stud.uni-regensburg.de> | 2015-10-20 16:12:34 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2015-10-21 16:45:11 +0200 |
commit | 0b457a5fd70dbc65fc114e0b4ff2a7bb607b22ad (patch) | |
tree | 67b246335af4921b4254733b691824d92906785e /source/pdf/pdf-xref.c | |
parent | 7a3f8bfba47b2c63036eec4968cf15899c716e13 (diff) | |
download | mupdf-0b457a5fd70dbc65fc114e0b4ff2a7bb607b22ad.tar.xz |
Fix signatures for files created with pdf_create_document.
See Bug 696284. Do not set disallow_new_increments in pdf_create_document, as
this breaks following calls to pdf_sign_signature.
See also the comments in bug 696251.
Diffstat (limited to 'source/pdf/pdf-xref.c')
-rw-r--r-- | source/pdf/pdf-xref.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index 29439926..f65edefc 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -2744,7 +2744,7 @@ pdf_document *pdf_create_document(fz_context *ctx) doc->num_xref_sections = 0; doc->num_incremental_sections = 0; doc->xref_base = 0; - doc->disallow_new_increments = 1; + doc->disallow_new_increments = 0; pdf_get_populating_xref_entry(ctx, doc, 0); trailer = pdf_new_dict(ctx, doc, 2); pdf_dict_put_drop(ctx, trailer, PDF_NAME_Size, pdf_new_int(ctx, doc, 3)); @@ -2760,8 +2760,8 @@ pdf_document *pdf_create_document(fz_context *ctx) pdf_dict_put_drop(ctx, pages, PDF_NAME_Type, PDF_NAME_Pages); pdf_dict_put_drop(ctx, pages, PDF_NAME_Count, pdf_new_int(ctx, doc, 0)); pdf_dict_put_drop(ctx, pages, PDF_NAME_Kids, pdf_new_array(ctx, doc, 1)); - pdf_set_populating_xref_trailer(ctx, doc, trailer); - pdf_drop_obj(ctx, trailer); + /* Set the trailer of the final xref section. */ + doc->xref_sections[0].trailer = trailer; } fz_catch(ctx) { |