[poppler] poppler/Annot.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Thu Mar 10 16:02:30 PST 2011


 poppler/Annot.cc |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 9671fe07f8c9ade956742cb141b99518c3b12bad
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri Mar 11 00:05:52 2011 +0000

    getForm can return NULL, do not crash if that happens

diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 036f15a..e73b3ab 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -5157,10 +5157,12 @@ Annot *Annots::createAnnot(XRef *xref, Dict* dict, Catalog *catalog, Object *obj
       // Find the annot in forms
       if (obj->isRef()) {
         Form *form = catalog->getForm();
-        FormWidget *widget = form->findWidgetByRef(obj->getRef());
-        if (widget) {
-          annot = widget->getWidgetAnnotation();
-          annot->incRefCnt();
+        if (form) {
+          FormWidget *widget = form->findWidgetByRef(obj->getRef());
+          if (widget) {
+            annot = widget->getWidgetAnnotation();
+            annot->incRefCnt();
+          }
         }
       }
       if (!annot)


More information about the poppler mailing list