summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gardiner <paul.gardiner@artifex.com>2015-08-27 14:09:27 +0100
committerPaul Gardiner <paul.gardiner@artifex.com>2015-08-27 15:16:52 +0100
commit51def346963b9868f5a40f3d752435ed12aebe0c (patch)
tree566ba198917cf9a714ea29f659f27f51f441e004
parenta638d6d24069943fbc950587db2e03f18cfea581 (diff)
downloadmupdf-51def346963b9868f5a40f3d752435ed12aebe0c.tar.xz
Fix bug in setting of opts->ofs_list
In the incremental case, we should update ofs_list only when actually writing an object to file. This is work towards bug #696123.
-rw-r--r--source/pdf/pdf-write.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/pdf/pdf-write.c b/source/pdf/pdf-write.c
index 991341ca..021df307 100644
--- a/source/pdf/pdf-write.c
+++ b/source/pdf/pdf-write.c
@@ -2105,9 +2105,11 @@ dowriteobject(fz_context *ctx, pdf_document *doc, pdf_write_options *opts, int n
{
if (pass > 0)
padto(opts->out, opts->ofs_list[num]);
- opts->ofs_list[num] = fz_ftell(opts->out);
if (!opts->do_incremental || pdf_xref_is_incremental(ctx, doc, num))
+ {
+ opts->ofs_list[num] = fz_ftell(opts->out);
writeobject(ctx, doc, opts, num, opts->gen_list[num], 1);
+ }
}
else
opts->use_list[num] = 0;