From 7a3da853a8378ad05026041d13744a74ab87cc0f Mon Sep 17 00:00:00 2001 From: Tore Engvig Date: Thu, 7 Jun 2001 20:30:09 +0000 Subject: [PATCH] Fixed an array out of bounds that caused some combinations of word/pattern to crash git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194279 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/fop/layout/hyphenation/HyphenationTree.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/org/apache/fop/layout/hyphenation/HyphenationTree.java b/src/org/apache/fop/layout/hyphenation/HyphenationTree.java index bc0e7e532..ef78c6816 100644 --- a/src/org/apache/fop/layout/hyphenation/HyphenationTree.java +++ b/src/org/apache/fop/layout/hyphenation/HyphenationTree.java @@ -250,8 +250,9 @@ public class HyphenationTree extends TernaryTree values = getValues(eq[q]); int j=index; for(int k=0; k il[j] ) + if (j < il.length && values[k] > il[j] ) { il[j] = values[k]; + } j++; } break; @@ -330,14 +331,14 @@ public class HyphenationTree extends TernaryTree } } } else { - // use algorithm to get hyphenation points word[0] = '.'; // word start marker word[len+1] = '.'; // word end marker word[len+2] = 0; // null terminated byte[] il = new byte[len+3]; // initialized to zero - for(i=0; i 0 ) { // trim result array -- 2.39.5