[poppler] poppler/Form.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Sun Apr 3 11:19:53 PDT 2011


 poppler/Form.cc |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 722baf8baf42e2c7a49e1560aae5235677d1ddee
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Sun Apr 3 20:17:57 2011 +0200

    forms: check form field is actually terminal before creating the widget

diff --git a/poppler/Form.cc b/poppler/Form.cc
index b9a4a02..7a5860f 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -491,6 +491,10 @@ FormField::FormField(XRef* xrefA, Object *aobj, const Ref& aref, FormField *pare
           children[numChildren - 1] = Form::createFieldFromDict(&childObj, xref, ref, this, &usedParentsAux);
         } else if (childObj.dictLookup("Subtype", &obj2)->isName("Widget")) {
           // Child is a widget annotation
+          if (!terminal && numChildren > 0) {
+            error(-1, "Field can't have both Widget AND Field as kids\n");
+            continue;
+          }
           _createWidget(&childObj, ref);
         }
         obj2.free();


More information about the poppler mailing list