[poppler] poppler/Page.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Thu Jun 27 00:14:10 PDT 2013


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

New commits:
commit 2639957ba78defd2ab6282679375fb7969bad21f
Author: Fabio D'Urso <fabiodurso at hotmail.it>
Date:   Wed Jun 26 23:12:40 2013 +0200

    Do not crash in page::removeAnnot if there are non-Ref entries in /Annots

diff --git a/poppler/Page.cc b/poppler/Page.cc
index a587b9b..426a15d 100644
--- a/poppler/Page.cc
+++ b/poppler/Page.cc
@@ -454,11 +454,13 @@ void Page::removeAnnot(Annot *annot) {
     // Get annotation position
     for (int i = 0; idx == -1 && i < annArray.arrayGetLength(); ++i) {
       Object tmp;
-      Ref currAnnot = annArray.arrayGetNF(i, &tmp)->getRef();
-      tmp.free();
-      if (currAnnot.num == annotRef.num && currAnnot.gen == annotRef.gen) {
-        idx = i;
+      if (annArray.arrayGetNF(i, &tmp)->isRef()) {
+        Ref currAnnot = tmp.getRef();
+        if (currAnnot.num == annotRef.num && currAnnot.gen == annotRef.gen) {
+          idx = i;
+        }
       }
+      tmp.free();
     }
 
     if (idx == -1) {


More information about the poppler mailing list