diff options
author | Simon Steiner <ssteiner@apache.org> | 2014-04-28 14:24:22 +0000 |
---|---|---|
committer | Simon Steiner <ssteiner@apache.org> | 2014-04-28 14:24:22 +0000 |
commit | 040e4a7bbe9f400a28b91c2bf176d0e71f4b226c (patch) | |
tree | 368aebd8ce058d0f6f8dec3d14aeb05c527014b5 /src | |
parent | bc584b5ceac0a3fbc692292b617b183396239742 (diff) | |
download | xmlgraphics-fop-040e4a7bbe9f400a28b91c2bf176d0e71f4b226c.tar.gz xmlgraphics-fop-040e4a7bbe9f400a28b91c2bf176d0e71f4b226c.zip |
FOP-2336 OOM for tiff output
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1590653 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java b/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java index 8d0ce14ac..38911a9e9 100644 --- a/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java +++ b/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java @@ -229,7 +229,9 @@ public abstract class AbstractBitmapDocumentHandler extends AbstractBinaryWritin } //Set up bitmap to paint on - this.currentImage = createBufferedImage(bitmapWidth, bitmapHeight); + if (currentImage == null || currentImage.getWidth() != bitmapWidth || currentImage.getHeight() != bitmapHeight) { + currentImage = createBufferedImage(bitmapWidth, bitmapHeight); + } Graphics2D graphics2D = this.currentImage.createGraphics(); // draw page background @@ -316,7 +318,6 @@ public abstract class AbstractBitmapDocumentHandler extends AbstractBinaryWritin this.multiImageWriter.writeImage(this.currentImage, getSettings().getWriterParams()); } - this.currentImage = null; } catch (IOException ioe) { throw new IFException("I/O error while encoding BufferedImage", ioe); } |