diff options
author | Robin Watts <robin.watts@artifex.com> | 2015-03-25 18:51:57 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2015-03-25 19:04:44 +0000 |
commit | 3ec40f694351a626c1e7d81dcfdfbba3dd085ee3 (patch) | |
tree | 1ada90d475fd6ce67b05718516fc6e932f97f6ec | |
parent | 0bbafc586f1431d4a0059bb9c90981624d67e469 (diff) | |
download | mupdf-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.
-rw-r--r-- | source/pdf/pdf-write.c | 3 |
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) { |