diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-07-18 16:02:40 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-07-18 18:59:02 +0100 |
commit | 34aaac902ad9f5bc80931877102ef08c2b8b5088 (patch) | |
tree | ed26d0b16989fde2409c6b4865a41b23460fe850 /pdf/pdf_write.c | |
parent | c47b3796f4f0314a86e4a82f7d467f8130c96b6c (diff) | |
download | mupdf-34aaac902ad9f5bc80931877102ef08c2b8b5088.tar.xz |
Fix broken pdf_write functionality.
Since I implemented linearisation, any invocation that hasn't used
garbage collection has produced broken files, due to every object
being marked as freed. This was because I'd forgotten to ever set
the use_list markers to be 1. Fixed here.
Diffstat (limited to 'pdf/pdf_write.c')
-rw-r--r-- | pdf/pdf_write.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pdf/pdf_write.c b/pdf/pdf_write.c index 76ab1cb1..76f19748 100644 --- a/pdf/pdf_write.c +++ b/pdf/pdf_write.c @@ -731,7 +731,7 @@ static void renumberobjs(pdf_document *xref, pdf_write_options *opts) if (newlen < opts->renumber_map[num]) newlen = opts->renumber_map[num]; xref->table[opts->renumber_map[num]] = oldxref[num]; - new_use_list[opts->renumber_map[num]] = opts->use_list[num]; + new_use_list[opts->renumber_map[num]] = 1; } else { @@ -2120,6 +2120,9 @@ void pdf_write_document(pdf_document *xref, char *filename, fz_write_options *fz /* Sweep & mark objects from the trailer */ if (opts.do_garbage >= 1) sweepobj(xref, &opts, xref->trailer); + else + for (num = 0; num < xref->len; num++) + opts.use_list[num] = 1; /* Coalesce and renumber duplicate objects */ if (opts.do_garbage >= 3) |