diff options
-rw-r--r-- | pdf/pdf_form.c | 4 |
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); |