diff options
author | Albert Astals Cid <aacid@kde.org> | 2020-04-07 17:54:22 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2020-04-08 00:14:26 +0200 |
commit | 155f73bdd261622323491df4aebb840cde8bfee1 (patch) | |
tree | 4fc7b92375cfa563b8fb89acfc53803ac6b7f6a0 /poppler/Page.cc | |
parent | 4098c6546d9be6ab93a817d52dd749b43aede868 (diff) |
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
Diffstat (limited to 'poppler/Page.cc')
-rw-r--r-- | poppler/Page.cc | 4 |
1 files changed, 2 insertions, 2 deletions
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@redhat.com> // Copyright (C) 2005 Jeff Muizelaar <jeff@infidigm.net> -// Copyright (C) 2005-2013, 2016-2019 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2013, 2016-2020 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2006-2008 Pino Toscano <pino@kde.org> // Copyright (C) 2006 Nickolay V. Shmyrev <nshmyrev@yandex.ru> // Copyright (C) 2006 Scott Turner <scotty1024@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) { |