You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/12/24 11:25:00 UTC

[jira] [Commented] (PDFBOX-5352) ArrayIndexOutOfBoundsException in PDSeparation.tintTransform()

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

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

Commit 1896350 from Tilman Hausherr in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1896350 ]

PDFBOX-5352: avoid ArrayIndexOutOfBoundsException

> ArrayIndexOutOfBoundsException in PDSeparation.tintTransform()
> --------------------------------------------------------------
>
>                 Key: PDFBOX-5352
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5352
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.25
>            Reporter: Tilman Hausherr
>            Assignee: Tilman Hausherr
>            Priority: Major
>             Fix For: 2.0.26, 3.0.0 PDFBox
>
>         Attachments: POPPLER-1184.pdf
>
>
> I get this with the attached file from the linked poppler issue
> {noformat}
> ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 3
>     org.apache.pdfbox.pdmodel.graphics.color.PDSeparation.tintTransform(PDSeparation.java:222)
>     org.apache.pdfbox.pdmodel.graphics.color.PDSeparation.toRGBImage(PDSeparation.java:169)
>     org.apache.pdfbox.pdmodel.graphics.color.PDIndexed.initRgbColorTable(PDIndexed.java:152)
>     org.apache.pdfbox.pdmodel.graphics.color.PDIndexed.<init>(PDIndexed.java:93)
>     org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.create(PDColorSpace.java:188)
> {noformat}
> The cause is that the range array is too short (7 elements for CMYK).
> I'll catch this in the constructor and return an exception. If there's a complaint then we could change the tintTransform() method so that it takes the minimum of alt.length and result.length.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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