Prevent recursion when parsing outlines

This commit is contained in:
Adrian-George Bostan 2019-09-19 19:38:24 +03:00
parent 07615469c9
commit da010a9d44

View File

@ -347,8 +347,8 @@ func (r *PdfReader) buildOutlineTree(obj core.PdfObject, parent *PdfOutlineTreeN
}
// Resolve the reference to next
if nextObj := dict.Get("Next"); nextObj != nil {
nextObj = core.ResolveReference(nextObj)
nextObj := core.ResolveReference(dict.Get("Next"))
if nextObj != nil && nextObj != container {
if _, isNull := nextObj.(*core.PdfObjectNull); !isNull {
next, last, err := r.buildOutlineTree(nextObj, parent, &outlineItem.PdfOutlineTreeNode)
if err != nil {