[ 
https://issues.apache.org/jira/browse/PDFBOX-6315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18147831#comment-18147831
 ] 

ASF subversion and git services commented on PDFBOX-6315:
---------------------------------------------------------

Commit 1940520 from Tilman Hausherr in branch 'pdfbox/branches/3.0'
[ https://svn.apache.org/r1940520 ]

PDFBOX-6315: avoid endless recursion, as suggested by Martin Mirchev

> StackOverflowError when rendering an optional content membership dictionary 
> whose /VE array contains itself
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-6315
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-6315
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 3.0.8 PDFBox, 4.0.0
>            Reporter: Martin Mirchev
>            Priority: Major
>         Attachments: ve-self-ref.pdf
>
>
> {{PageDrawer.isHiddenVisibilityExpression()}} recurses into nested {{/VE}} 
> arrays without tracking the
> arrays already visited, so a visibility expression that refers to itself 
> recurses until the stack
> overflows. Minimal file (attached, {{ve-self-ref.pdf}}, 569 bytes):
> {code}
> 5 0 obj <</Type/OCMD/VE 6 0 R>> endobj
> 6 0 obj [/Not 6 0 R] endobj
> % page content: /OC /oc1 BDC 0 0 m 40 40 l S EMC   with /Properties <</oc1 5 
> 0 R>>
> {code}
> {{Loader.loadPDF()}} succeeds, then {{new PDFRenderer(doc).renderImage(0)}} 
> throws
> {{java.lang.StackOverflowError}} (trunk bd0c9c0, 3/3 runs, {{-Xss512k}}; 510 
> {{isHiddenVisibilityExpression}}
> frames in the trace). A visited set (or a depth limit) around the recursion, 
> treating a cyclic
> expression as "not hidden", would avoid it.
> This issue was found by an LLM-assisted tool and verified manually.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to