--- old/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java 2016-09-16 17:19:12.242749011 +0530 +++ new/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java 2016-09-16 17:19:11.990749011 +0530 @@ -2437,6 +2437,10 @@ clearAbortRequest(); processImageStarted(0); + if (abortRequested()) { + processWriteAborted(); + return; + } // Optionally write the header. if (writeHeader) { @@ -2589,6 +2593,10 @@ pixelsDone += tileRect.width*tileRect.height; processImageProgress(100.0F*pixelsDone/totalPixels); + if (abortRequested()) { + processWriteAborted(); + return; + } // Fill in the offset and byte count for the file stream.mark(); @@ -2603,11 +2611,6 @@ } catch (IOException e) { throw new IIOException("I/O error writing TIFF file!", e); } - - if (abortRequested()) { - processWriteAborted(); - return; - } } }