Michael Graessle created PDFBOX-1411:
----------------------------------------

             Summary: [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
            Priority: Minor


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

Reply via email to