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

Tilman Hausherr updated PDFBOX-5199:
------------------------------------
    Description: 
valerybokov noticed in PR#107 that filters are sometimes closed and sometimes 
not
{quote}
IdentityFilter and CCITTFaxFilter extends Filter
IdentityFilter.encode(InputStream, OutputStream, COSDictionary). The 
InputStream will not be closed.
CCITTFaxFilter.encode(InputStream, OutputStream, COSDictionary). The 
InputStream will be closed.
The input parameter will not be closed if an exception is thrown.
{quote}
My understanding is that the caller should close streams unless the javadoc 
tell something else. So I did search a bit, and found places in COSStream and 
PDStream where this isn't done. Any close in filter should be removed.

I also searched for encode but there I found that the caller closes properly.

  was:
valerybokov noticed in PR#107 that filters are sometimes closed and sometimes 
not
{quote}
IdentityFilter and CCITTFaxFilter extends Filter
IdentityFilter.encode(InputStream, OutputStream, COSDictionary). The 
InputStream will not be closed.
CCITTFaxFilter.encode(InputStream, OutputStream, COSDictionary). The 
InputStream will be closed.
The input parameter will not be closed if an exception is thrown.
{quote}
My understanding is that the caller should close streams unless the javadoc 
tell something else. So I did search a bit, and found places in COSInputStream, 
COSStream and PDStream where this isn't done. Any close in filter should be 
removed.

I also searched for encode but there I found that the caller closes properly.


> Possible memory leak after calling decode filter
> ------------------------------------------------
>
>                 Key: PDFBOX-5199
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5199
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.23
>            Reporter: Tilman Hausherr
>            Priority: Minor
>             Fix For: 2.0.24, 3.0.0 PDFBox
>
>
> valerybokov noticed in PR#107 that filters are sometimes closed and sometimes 
> not
> {quote}
> IdentityFilter and CCITTFaxFilter extends Filter
> IdentityFilter.encode(InputStream, OutputStream, COSDictionary). The 
> InputStream will not be closed.
> CCITTFaxFilter.encode(InputStream, OutputStream, COSDictionary). The 
> InputStream will be closed.
> The input parameter will not be closed if an exception is thrown.
> {quote}
> My understanding is that the caller should close streams unless the javadoc 
> tell something else. So I did search a bit, and found places in COSStream and 
> PDStream where this isn't done. Any close in filter should be removed.
> I also searched for encode but there I found that the caller closes properly.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to