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

New commits:
commit 155f73bdd261622323491df4aebb840cde8bfee1
Author: Albert Astals Cid <aa...@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 <hmercie...@gmail.com>
 // Copyright (C) 2008 Pino Toscano <p...@kde.org>
 // Copyright (C) 2008 Tomas Are Haavet <tomas...@gmail.com>
-// Copyright (C) 2009-2011, 2013, 2016-2019 Albert Astals Cid <aa...@kde.org>
+// Copyright (C) 2009-2011, 2013, 2016-2020 Albert Astals Cid <aa...@kde.org>
 // Copyright (C) 2012, 2013 Fabio D'Urso <fabiodu...@hotmail.it>
 // Copyright (C) 2012, 2015 Tobias Koenig <to...@kdab.com>
 // Copyright (C) 2013 Thomas Freitag <thomas.frei...@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 <k...@redhat.com>
 // Copyright (C) 2005 Jeff Muizelaar <j...@infidigm.net>
-// Copyright (C) 2005-2013, 2016-2019 Albert Astals Cid <aa...@kde.org>
+// Copyright (C) 2005-2013, 2016-2020 Albert Astals Cid <aa...@kde.org>
 // Copyright (C) 2006-2008 Pino Toscano <p...@kde.org>
 // Copyright (C) 2006 Nickolay V. Shmyrev <nshmy...@yandex.ru>
 // Copyright (C) 2006 Scott Turner <scotty1...@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) {
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to