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

Tilman Hausherr resolved PDFBOX-2047.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0
                   1.8.6

> read operations alter PDLab object
> ----------------------------------
>
>                 Key: PDFBOX-2047
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2047
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 1.8.4, 1.8.5, 2.0.0
>            Reporter: Tilman Hausherr
>            Assignee: Tilman Hausherr
>             Fix For: 1.8.6, 2.0.0
>
>
> This is a follow-up to PDFBOX-2042 but for PDLab: "A read operation must not 
> alter the pdf." 
> The problem described PDFBOX-2042 happened because the constructor called 
> loadICCProfile(), which called getRangeForComponent(c), which altered its own 
> object with (broken) default values. PDLab has no such constructor so Jurajs 
> test won't show any problem, but this different test will:
> {code}
>         PDLab pdLab = new PDLab();
>         COSArray cosArray = (COSArray) pdLab.getCOSObject();
>         COSDictionary dict = (COSDictionary)cosArray.getObject(1);
>         pdLab.getBlackPoint();
>         pdLab.getWhitepoint();
>         pdLab.getARange();
>         pdLab.getBRange();
>         assertEquals("read operations should not change the size of /Lab 
> objects", 0, dict.size());
>         dict.toString(); // rev 1571125 does stack overflow here in 2.0
> {code}
> removing the assert brings a stack overflow.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to