[poppler] poppler/Outline.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed May 17 21:05:36 UTC 2023


 poppler/Outline.cc |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 591235c8b6c65a2eee88991b9ae73490fd9afdfe
Author: Albert Astals Cid <aacid at kde.org>
Date:   Wed May 17 22:42:05 2023 +0200

    OutlineItem::open: Fix crash on malformed files
    
    Fixes #1399

diff --git a/poppler/Outline.cc b/poppler/Outline.cc
index cbb6cb49..4c68be99 100644
--- a/poppler/Outline.cc
+++ b/poppler/Outline.cc
@@ -14,7 +14,7 @@
 // under GPL version 2 or later
 //
 // Copyright (C) 2005 Marco Pesenti Gritti <mpg at redhat.com>
-// Copyright (C) 2008, 2016-2019, 2021 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2008, 2016-2019, 2021, 2023 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2009 Nick Jones <nick.jones at network-box.com>
 // Copyright (C) 2016 Jason Crain <jason at aquaticape.us>
 // Copyright (C) 2017 Adrian Johnson <ajohnson at redneon.com>
@@ -483,8 +483,12 @@ void OutlineItem::open()
 {
     if (!kids) {
         Object itemDict = xref->fetch(ref);
-        const Object &firstRef = itemDict.dictLookupNF("First");
-        kids = readItemList(this, &firstRef, xref, doc);
+        if (itemDict.isDict()) {
+            const Object &firstRef = itemDict.dictLookupNF("First");
+            kids = readItemList(this, &firstRef, xref, doc);
+        } else {
+            kids = new std::vector<OutlineItem *>();
+        }
     }
 }
 


More information about the poppler mailing list