summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gardiner <paulg.artifex@glidos.net>2012-09-19 14:59:36 +0100
committerPaul Gardiner <paulg.artifex@glidos.net>2012-09-19 14:59:36 +0100
commite9cf056f2d69b6ca5cb66f339978e461911e9c02 (patch)
tree1a15a3fb0038746813dcd61611c8183e29efb48a
parent415ae3908a392363b2196ce8c0c913c78e2f0320 (diff)
downloadmupdf-e9cf056f2d69b6ca5cb66f339978e461911e9c02.tar.xz
Forms: correct bug in form reset
If the 'fields' parameter is not present then all fields should be reset
-rw-r--r--pdf/pdf_form.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pdf/pdf_form.c b/pdf/pdf_form.c
index 76e28058..4cbf6614 100644
--- a/pdf/pdf_form.c
+++ b/pdf/pdf_form.c
@@ -1589,7 +1589,9 @@ static void reset_form(pdf_document *doc, pdf_obj *fields, int exclude)
pdf_obj *form = pdf_dict_getp(doc->trailer, "Root/AcroForm/Fields");
int i, n;
- if (exclude)
+ /* The 'fields' array not being present signals that all fields
+ * should be reset, so handle it using the exclude case - excluding none */
+ if (exclude || !fields)
{
/* mark the fields we don't want to reset */
pdf_obj *nil = pdf_new_null(ctx);