From e02936ef8dbe59f862465d30cf021b8758385f70 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Wed, 27 Aug 2008 08:28:47 +0000 Subject: [PATCH] Fixed ArrayIndexOutOfBoundsException when there is a long text with very few kerning adjustments. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@689408 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/render/intermediate/IFRenderer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/fop/render/intermediate/IFRenderer.java b/src/java/org/apache/fop/render/intermediate/IFRenderer.java index e9190be88..8831656e1 100644 --- a/src/java/org/apache/fop/render/intermediate/IFRenderer.java +++ b/src/java/org/apache/fop/render/intermediate/IFRenderer.java @@ -924,7 +924,8 @@ public class IFRenderer extends AbstractPathOrientedRenderer { if (adjust != 0) { int idx = text.length(); if (idx > dx.length - 1) { - int[] newDX = new int[dx.length + INITIAL_BUFFER_SIZE]; + int newSize = Math.max(dx.length, idx + 1) + INITIAL_BUFFER_SIZE; + int[] newDX = new int[newSize]; System.arraycopy(dx, 0, newDX, 0, dx.length); dx = newDX; } -- 2.39.5