[poppler] poppler/Annot.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sat May 3 09:23:04 PDT 2008


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

New commits:
commit 914f1b1d814ab3d958aa0ca21ad73ef5aed20b89
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat May 3 18:21:28 2008 +0200

    A widget annot does not always belong to a form, so check before accessing the widget member

diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index ecf76d8..11c91fa 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -1815,7 +1815,7 @@ void AnnotWidget::initialize(XRef *xrefA, Catalog *catalog, Dict *dict) {
     // Only text or choice fields needs to have appearance regenerated
     // see section 8.6.2 "Variable Text" of PDFReference
     regen = gFalse;
-    if (widget->getType () == formText || widget->getType () == formChoice) {
+    if (widget != NULL && (widget->getType () == formText || widget->getType () == formChoice)) {
       regen = form->getNeedAppearances ();
     }
   }
@@ -2658,7 +2658,7 @@ void AnnotWidget::generateFieldAppearance() {
   int dashLength, ff, quadding, comb, nOptions, topIdx, i, j;
   GBool modified;
 
-  if (!widget->getField () || !widget->getField ()->getObj ()->isDict ())
+  if (widget == NULL || !widget->getField () || !widget->getField ()->getObj ()->isDict ())
     return;
 
   field = widget->getField ()->getObj ()->getDict ();


More information about the poppler mailing list