You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andrew Duffy (JIRA)" <ji...@apache.org> on 2009/09/08 15:30:57 UTC

[jira] Updated: (PDFBOX-518) ArrayIndexOutOfBoundsException in PDInlinedImage.java

     [ https://issues.apache.org/jira/browse/PDFBOX-518?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Duffy updated PDFBOX-518:
--------------------------------

    Attachment: aioob.patch

The attached patch fixes the bug; it makes the end condition of the loop between lines 168 and 172 the same as the one between lines 174 and 181. It's consistent now - both loops will fail if the image data is bigger than expected and not fail if it's smaller.

The second loop (174 -181) looks wrong - each byte is copied into an int? Surely a rater with an int buffer expects packed RGB or ARGB data?

> ArrayIndexOutOfBoundsException in PDInlinedImage.java
> -----------------------------------------------------
>
>                 Key: PDFBOX-518
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-518
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 0.8.0-incubator
>            Reporter: Andrew Duffy
>            Priority: Minor
>         Attachments: aioob.patch
>
>
> I can't post a sample PDF, but the trace is:
> java.lang.ArrayIndexOutOfBoundsException
>  	at java.lang.System.arraycopy(Native Method)
>  	at org.apache.pdfbox.pdmodel.graphics.xobject.PDInlinedImage.createImage(PDInlinedImage.java:171)
>  	at org.apache.pdfbox.util.operator.pagedrawer.BeginInlineImage.process(BeginInlineImage.java:57)
>  	at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:510)
>  	at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:223)
>  	at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:182)
>  	at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:92)
>  	at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:686)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.