diff --git a/src/UglyToad.PdfPig/Parser/CatalogFactory.cs b/src/UglyToad.PdfPig/Parser/CatalogFactory.cs index da2bb2cc..dd31ae59 100644 --- a/src/UglyToad.PdfPig/Parser/CatalogFactory.cs +++ b/src/UglyToad.PdfPig/Parser/CatalogFactory.cs @@ -102,8 +102,8 @@ do { - var current = toProcess.Dequeue(); - + var current = toProcess.Dequeue(); + if (current.reference.GetHashCode() == current.parentReference.GetHashCode()) { continue; } // Issue #519 if (!current.nodeDictionary.TryGet(NameToken.Kids, pdfTokenScanner, out ArrayToken kids)) { if (!isLenientParsing)