diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-12-12 15:04:51 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-12-16 02:16:58 +0100 |
commit | 718ce3051843a684084fb15d890aab8945605f60 (patch) | |
tree | 432d470edd4526f74b1e12eb4d0bb1392bd51f30 | |
parent | 508db7953f094f58e9a99172c7803c3e67afe308 (diff) | |
download | mupdf-718ce3051843a684084fb15d890aab8945605f60.tar.xz |
pdf: Don't allow incremental writes on a new document.
-rw-r--r-- | source/pdf/pdf-write.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/pdf/pdf-write.c b/source/pdf/pdf-write.c index b392bac5..645d0539 100644 --- a/source/pdf/pdf-write.c +++ b/source/pdf/pdf-write.c @@ -3066,6 +3066,8 @@ void pdf_save_document(fz_context *ctx, pdf_document *doc, const char *filename, if (!in_opts) in_opts = &opts_defaults; + if (in_opts->do_incremental && !doc->file) + fz_throw(ctx, FZ_ERROR_GENERIC, "Can't do incremental writes on a new document"); if (in_opts->do_incremental && doc->repair_attempted) fz_throw(ctx, FZ_ERROR_GENERIC, "Can't do incremental writes on a repaired file"); if (in_opts->do_incremental && in_opts->do_garbage) |