[poppler] poppler/Catalog.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Nov 29 11:27:39 PST 2010


 poppler/Catalog.cc |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit d2a0e2ca723142478858f7edfb7c98807d554578
Author: Hib Eris <hib at hiberis.nl>
Date:   Thu Nov 25 10:36:38 2010 +0000

    Skip over loops in Pages tree

diff --git a/poppler/Catalog.cc b/poppler/Catalog.cc
index 0beee76..297cac5 100644
--- a/poppler/Catalog.cc
+++ b/poppler/Catalog.cc
@@ -320,15 +320,20 @@ GBool Catalog::cachePageTree(int page)
       return gFalse;
     }
 
+    GBool loop = gFalse;;
     for (size_t i = 0; i < pagesRefList->size(); i++) {
       if (((*pagesRefList)[i]).num == kidRef.getRefNum()) {
-         error(-1, "Loop in Pages tree");
-         kidRef.free();
-         kids.free();
-         kidsIdxList->back()++;
-         continue;
+         loop = gTrue;
+         break;
       }
     }
+    if (loop) {
+      error(-1, "Loop in Pages tree");
+      kidRef.free();
+      kids.free();
+      kidsIdxList->back()++;
+      continue;
+    }
 
     Object kid;
     kids.arrayGet(kidsIdx, &kid);


More information about the poppler mailing list