[poppler] poppler/Annot.h poppler/Page.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 7 22:26:43 UTC 2020


 poppler/Annot.h |    4 ++--
 poppler/Page.cc |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 155f73bdd261622323491df4aebb840cde8bfee1
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Apr 7 17:54:22 2020 +0200

    Fix crash in destruction of standalone forms
    
    If we just give the Dict to Object() it doesn't increase the ref
    so on destruction we do one unref too much (because we had done one ref
    too few) and crash

diff --git a/poppler/Annot.h b/poppler/Annot.h
index 7e911f28..47d8b48b 100644
--- a/poppler/Annot.h
+++ b/poppler/Annot.h
@@ -21,7 +21,7 @@
 // Copyright (C) 2008 Hugo Mercier <hmercier31 at gmail.com>
 // Copyright (C) 2008 Pino Toscano <pino at kde.org>
 // Copyright (C) 2008 Tomas Are Haavet <tomasare at gmail.com>
-// Copyright (C) 2009-2011, 2013, 2016-2019 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2009-2011, 2013, 2016-2020 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2012, 2013 Fabio D'Urso <fabiodurso at hotmail.it>
 // Copyright (C) 2012, 2015 Tobias Koenig <tokoe at kdab.com>
 // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag at alfa.de>
@@ -697,7 +697,7 @@ public:
   PDFDoc *getDoc() const { return doc; }
   bool getHasRef() const { return hasRef; }
   Ref getRef() const { return ref; }
-  Dict *getDict() const { return annotObj.getDict(); }
+  const Object &getAnnotObj() const { return annotObj; }
   AnnotSubtype getType() const { return type; }
   PDFRectangle *getRect() const { return rect.get(); }
   void getRect(double *x1, double *y1, double *x2, double *y2) const;
diff --git a/poppler/Page.cc b/poppler/Page.cc
index babc63d1..5140174a 100644
--- a/poppler/Page.cc
+++ b/poppler/Page.cc
@@ -15,7 +15,7 @@
 //
 // Copyright (C) 2005 Kristian Høgsberg <krh at redhat.com>
 // Copyright (C) 2005 Jeff Muizelaar <jeff at infidigm.net>
-// Copyright (C) 2005-2013, 2016-2019 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2005-2013, 2016-2020 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2006-2008 Pino Toscano <pino at kde.org>
 // Copyright (C) 2006 Nickolay V. Shmyrev <nshmyrev at yandex.ru>
 // Copyright (C) 2006 Scott Turner <scotty1024 at mac.com>
@@ -378,7 +378,7 @@ void Page::loadStandaloneFields(Annots *annotations, Form *form) {
       continue; // this annot is referenced inside Form, skip it
 
     std::set<int> parents;
-    FormField *field = Form::createFieldFromDict (Object(annot->getDict()),
+    FormField *field = Form::createFieldFromDict (annot->getAnnotObj().copy(),
                                                   annot->getDoc(), r, nullptr, &parents);
 
     if (field && field->getType() == formButton && field->getNumWidgets() == 1) {


More information about the poppler mailing list