You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (JIRA)" <ji...@apache.org> on 2012/09/16 17:17:07 UTC

[jira] [Resolved] (PDFBOX-1411) [Patch] PDPixelMap.createImageStream can attempt to close output stream it didn't open, hiding errors.

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

Andreas Lehmkühler resolved PDFBOX-1411.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.8.0
         Assignee: Andreas Lehmkühler

I added the patch in revision 1385280 as proposed.

Thanks for the contribution!
                
> [Patch] PDPixelMap.createImageStream can attempt to close output stream it didn't open, hiding errors.
> ------------------------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-1411
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1411
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.7.0
>         Environment: All
>            Reporter: Michael Graessle
>            Assignee: Andreas Lehmkühler
>            Priority: Minor
>             Fix For: 1.8.0
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> Under some error conditions, PDPixelMap.createImageStream will attempt to close a null output stream, hiding the original exception.
> The following patch will fix this issue
> Index: pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDPixelMap.java
> ===================================================================
> --- pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDPixelMap.java     (revision 1383964)
> +++ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDPixelMap.java     (working copy)
> @@ -156,7 +156,9 @@
>          }
>          finally
>          {
> -            os.close();
> +            if (os != null) {
> +                os.close();
> +            }
>          }
>      }
>      /**

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira