File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/outline Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 1616 */
1717package org .apache .pdfbox .pdmodel .interactive .documentnavigation .outline ;
1818
19+ import org .apache .logging .log4j .LogManager ;
20+ import org .apache .logging .log4j .Logger ;
1921
2022import org .apache .pdfbox .cos .COSDictionary ;
2123import org .apache .pdfbox .cos .COSName ;
2830 */
2931public abstract class PDOutlineNode extends PDDictionaryWrapper
3032{
33+ private static final Logger LOG = LogManager .getLogger (PDOutlineNode .class );
3134
3235 /**
3336 * Default Constructor.
@@ -283,6 +286,12 @@ void updateParentOpenCount(int delta)
283286 PDOutlineNode parent = getParent ();
284287 if (parent != null )
285288 {
289+ if (getCOSObject () == parent .getCOSObject ())
290+ {
291+ // PDFBOX-5939
292+ LOG .warn ("Outline parent points to itself" );
293+ return ;
294+ }
286295 if (parent .isNodeOpen ())
287296 {
288297 parent .setOpenCount (parent .getOpenCount () + delta );
You can’t perform that action at this time.
0 commit comments