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

Daniel Persson commented on PDFBOX-5795:
----------------------------------------

Hi  [~tilman] 

 

Seems reasonable. I've tried it, and it seems to work just fine visually. And 
anyway, my patch would have needed a null pointer check as well, so we don't 
introduce that error. I vote for your suggestion.

 

Best regards

Daniel

> Crash for Softmask with incorrect backdrop color components
> -----------------------------------------------------------
>
>                 Key: PDFBOX-5795
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5795
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.31, 3.0.2 PDFBox
>            Reporter: Daniel Persson
>            Priority: Major
>         Attachments: borsen-2065-20111030-1-p4.pdf, crashfix.patch
>
>
> This error occured in our production of an old archive. None of the files 
> crashed in any other viewer (Chrome, Adobe, Firefox, Poppler a.s.o). 
>  
> I've read up on the subject in the 1.7 specification, and it seems like 
> PDFBox is following the specification, but not being able to open these files 
> seems a bit too strict.
>  
> The easiest way to reproduce is just to open the attached file with the 
> debugger.
> {code:java}
> java -jar debugger-app-4.0.0-SNAPSHOT.jar borsen-2065-20111030-1-p4.pdf {code}
> The application will crash with this exception:
> {code:java}
> Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds 
> for length 1
>     org.apache.pdfbox.pdmodel.graphics.color.PDColor.toRGB(PDColor.java:155)
>     
> org.apache.pdfbox.rendering.PageDrawer$TransparencyGroup.<init>(PageDrawer.java:1696)
>     
> org.apache.pdfbox.rendering.PageDrawer$TransparencyGroup.<init>(PageDrawer.java:1573)
>     
> org.apache.pdfbox.rendering.PageDrawer.applySoftMaskToPaint(PageDrawer.java:604)
>     
> org.apache.pdfbox.rendering.PageDrawer.showTransparencyGroupOnGraphics(PageDrawer.java:1549)
>     
> org.apache.pdfbox.rendering.PageDrawer.showTransparencyGroup(PageDrawer.java:1489)
>     
> org.apache.pdfbox.contentstream.operator.graphics.DrawObject.process(DrawObject.java:81)
>     
> org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:872)
>     
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:511)
>     
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:489)
>     
> org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:158)
>     org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:270)
>     org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:346)
>     
> org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.doInBackground(PagePane.java:527)
>     
> org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.doInBackground(PagePane.java:506)
>     java.base/java.lang.Thread.run(Thread.java:833)
>  {code}
> My solution, added as a patch, is to add a fallback to the colorspace 
> available in the graphical context. This is working for the files I've tried 
> so far.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to