diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-01-24 16:18:55 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-01-31 11:56:59 +0100 |
commit | de39f005f12a1afc6973c1f5cec362d6545f70cb (patch) | |
tree | a517eceada2de6f8e8d3da938d372f9775e133d1 | |
parent | 580437136972616a93c9f2c76de12050bd6af364 (diff) | |
download | mupdf-de39f005f12a1afc6973c1f5cec362d6545f70cb.tar.xz |
Don't load an xobject before the stream is final when creating new forms.
-rw-r--r-- | source/pdf/pdf-appearance.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/pdf/pdf-appearance.c b/source/pdf/pdf-appearance.c index d6520a71..bca9da86 100644 --- a/source/pdf/pdf-appearance.c +++ b/source/pdf/pdf-appearance.c @@ -1003,13 +1003,16 @@ static pdf_xobject *load_or_create_form(fz_context *ctx, pdf_document *doc, pdf_ create_form = 1; } - form = pdf_load_xobject(ctx, doc, formobj); if (create_form) { fzbuf = fz_new_buffer(ctx, 1); - pdf_update_xobject_contents(ctx, doc, form, fzbuf); + pdf_update_stream(ctx, doc, formobj, fzbuf, 0); } + form = pdf_load_xobject(ctx, doc, formobj); + + form->iteration = 1; + copy_resources(ctx, pdf_xobject_resources(ctx, form), pdf_get_inheritable(ctx, doc, obj, PDF_NAME_DR)); } fz_always(ctx) |