# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: JBIG2Filter.java
--- JBIG2Filter.java Remotely Modified (Based On HEAD)
+++ JBIG2Filter.java Locally Modified (Based On LOCAL)
@@ -16,6 +16,7 @@
  */
 package org.apache.pdfbox.filter;
 
+import java.awt.Graphics;
 import java.awt.image.BufferedImage;
 import java.awt.image.DataBuffer;
 import java.awt.image.DataBufferByte;
@@ -53,6 +54,7 @@
      * {@inheritDoc}
      *
      */
+    @Override
     public void decode( InputStream compressedData, OutputStream result, COSDictionary options, int filterIndex )
         throws IOException
     {
@@ -98,7 +100,9 @@
                 }
                 BufferedImage packedImage = 
                         new BufferedImage(bi.getWidth(), bi.getHeight(), BufferedImage.TYPE_BYTE_BINARY);
-                packedImage.getGraphics().drawImage(bi, 0, 0, null);
+                Graphics graphics = packedImage.getGraphics();
+                graphics.drawImage(bi, 0, 0, null);
+                graphics.dispose();                
                 bi = packedImage;
             }
             DataBuffer dBuf = bi.getData().getDataBuffer();
@@ -120,6 +124,7 @@
     /**
      * {@inheritDoc}
      */
+    @Override
     public void encode( InputStream rawData, OutputStream result, COSDictionary options, int filterIndex )
         throws IOException
     {
