COSWriter.visitFromStream() does not close InputStream.
-------------------------------------------------------

                 Key: PDFBOX-1030
                 URL: https://issues.apache.org/jira/browse/PDFBOX-1030
             Project: PDFBox
          Issue Type: Bug
          Components: Writing
    Affects Versions: 1.5.0, 1.4.0
         Environment: all
            Reporter: Wolfgang Glas
             Fix For: 1.6.0


We use pdfbox inside apache-karaf to write complex PDF files.

Therefore we are including several COSStreams in the PDF file to be written. 
Some of the COSStream's use a scratch file for storing the stream content.

Inspecting the open files of my apache-karaf unveiled, that these scratch files 
a still open after writing the PDDocument and closing it.

Therefore I inspected the code inside COSWriter.visitFromStream(COSStream) and 
found out, the the InputStream name 'input' opened  right at the beginning is 
never closed.

Please add a finally-clause, which robustely closes this input stream.

I inspected pdfbox-1.4.0 and the current SVN revision under

http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java?revision=1092855&view=markup

I would be very nice, if this issue could be fixed before pdfbox-1.6.0
 
 TIA and best regards, Wolfgang

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to