Tilman Hausherr created PDFBOX-2047:
---------------------------------------

             Summary: 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


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