[poppler] poppler/FontInfo.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 5 14:43:08 UTC 2019


 poppler/FontInfo.cc |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 8051f678b3b43326e5fdfd7c03f39de21059f426
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri Apr 5 16:34:48 2019 +0200

    FontInfoScanner::scanFonts Fix infinite loop in broken files
    
    Fixes #752

diff --git a/poppler/FontInfo.cc b/poppler/FontInfo.cc
index 2c3be4c6..cd335771 100644
--- a/poppler/FontInfo.cc
+++ b/poppler/FontInfo.cc
@@ -144,7 +144,17 @@ void FontInfoScanner::scanFonts(XRef *xrefA, Dict *resDict, std::vector<FontInfo
 
         Object obj2 = dictObjI.fetch(xrefA);
         if (obj2.isStream()) {
-          Object resObj = obj2.streamGetDict()->lookup("Resources");
+          Ref resourcesRef;
+          const Object resObj = obj2.streamGetDict()->lookup("Resources", &resourcesRef);
+
+          if (resourcesRef != Ref::INVALID()) {
+            if (visitedObjects.find(resourcesRef.num) != visitedObjects.end()) {
+              continue;
+            }
+
+            visitedObjects.insert(resourcesRef.num);
+          }
+
           if (resObj.isDict() && resObj.getDict() != resDict) {
             scanFonts(xrefA, resObj.getDict(), fontsList);
           }


More information about the poppler mailing list