summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-write.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2015-03-25 18:51:57 +0000
committerRobin Watts <robin.watts@artifex.com>2015-03-25 19:04:44 +0000
commit3ec40f694351a626c1e7d81dcfdfbba3dd085ee3 (patch)
tree1ada90d475fd6ce67b05718516fc6e932f97f6ec /source/pdf/pdf-write.c
parent0bbafc586f1431d4a0059bb9c90981624d67e469 (diff)
downloadmupdf-3ec40f694351a626c1e7d81dcfdfbba3dd085ee3.tar.xz
Bug 695864: Avoid assertion if a file is saved incrementally twice.
The actual fix implemented here is to bale out of pdf_write_document if we are updating incrementally and the file has not changed.
Diffstat (limited to 'source/pdf/pdf-write.c')
-rw-r--r--source/pdf/pdf-write.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/pdf/pdf-write.c b/source/pdf/pdf-write.c
index df5004e2..20c9bfca 100644
--- a/source/pdf/pdf-write.c
+++ b/source/pdf/pdf-write.c
@@ -2591,6 +2591,9 @@ void pdf_write_document(fz_context *ctx, pdf_document *doc, char *filename, fz_w
if (fz_opts->do_incremental)
{
+ /* If no changes, nothing to write */
+ if (!doc->xref_altered)
+ return;
opts.out = fopen(filename, "ab");
if (opts.out)
{