[poppler] poppler/Page.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Sun Jul 25 04:58:04 PDT 2010


 poppler/Page.cc |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 627edf88c8f5c073a68bd05990df56e1af547292
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Sun Jul 25 13:56:03 2010 +0200

    [annots] Fix a crash when adding a new annotation and annots object is an array
    
    When annots object is an array instead of a ref, the modified object is
    actually de page object.

diff --git a/poppler/Page.cc b/poppler/Page.cc
index a9ad2b8..dc3ff69 100644
--- a/poppler/Page.cc
+++ b/poppler/Page.cc
@@ -376,7 +376,10 @@ void Page::addAnnot(Annot *annot) {
     getAnnots(&obj1);
     if (obj1.isArray()) {
       obj1.arrayAdd (tmp.initRef (annotRef.num, annotRef.gen));
-      xref->setModifiedObject (&obj1, annots.getRef());
+      if (annots.isRef())
+        xref->setModifiedObject (&obj1, annots.getRef());
+      else
+        xref->setModifiedObject (&pageObj, pageRef);
     }
     obj1.free();
   }


More information about the poppler mailing list