diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2017-12-11 13:04:36 +0100 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2017-12-13 21:38:26 +0100 |
commit | 22985917f145d86c975c77399110e566ad3231c3 (patch) | |
tree | 81e72659ccfa42765ee947502809f10db23c3163 /source/pdf | |
parent | 55c3f68d638ac1263a386e0aaa004bb6e8bde731 (diff) | |
download | mupdf-22985917f145d86c975c77399110e566ad3231c3.tar.xz |
Never write negative xref offsets when saving to PDF.
Diffstat (limited to 'source/pdf')
-rw-r--r-- | source/pdf/pdf-write.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/pdf/pdf-write.c b/source/pdf/pdf-write.c index 9fcdbf0a..51f7ad7a 100644 --- a/source/pdf/pdf-write.c +++ b/source/pdf/pdf-write.c @@ -1946,9 +1946,9 @@ static void writexrefsubsect(fz_context *ctx, pdf_write_state *opts, int from, i for (num = from; num < to; num++) { if (opts->use_list[num]) - fz_write_printf(ctx, opts->out, "%010ld %05d n \n", opts->ofs_list[num], opts->gen_list[num]); + fz_write_printf(ctx, opts->out, "%010lu %05d n \n", opts->ofs_list[num], opts->gen_list[num]); else - fz_write_printf(ctx, opts->out, "%010ld %05d f \n", opts->ofs_list[num], opts->gen_list[num]); + fz_write_printf(ctx, opts->out, "%010lu %05d f \n", opts->ofs_list[num], opts->gen_list[num]); } } @@ -2031,7 +2031,7 @@ static void writexref(fz_context *ctx, pdf_document *doc, pdf_write_state *opts, pdf_drop_obj(ctx, trailer); - fz_write_printf(ctx, opts->out, "startxref\n%ld\n%%%%EOF\n", startxref); + fz_write_printf(ctx, opts->out, "startxref\n%lu\n%%%%EOF\n", startxref); doc->has_xref_streams = 0; } @@ -2155,7 +2155,7 @@ static void writexrefstream(fz_context *ctx, pdf_document *doc, pdf_write_state pdf_update_stream(ctx, doc, dict, fzbuf, 0); writeobject(ctx, doc, opts, num, 0, 0); - fz_write_printf(ctx, opts->out, "startxref\n%ld\n%%%%EOF\n", startxref); + fz_write_printf(ctx, opts->out, "startxref\n%lu\n%%%%EOF\n", startxref); } fz_always(ctx) { |