tore        01/06/07 14:02:04

  Modified:    src/org/apache/fop/layout/hyphenation HyphenationTree.java
  Log:
  Fixed another array out of bounds bug
  
  Revision  Changes    Path
  1.3       +9 -7      
xml-fop/src/org/apache/fop/layout/hyphenation/HyphenationTree.java
  
  Index: HyphenationTree.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/layout/hyphenation/HyphenationTree.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HyphenationTree.java      2001/06/07 20:30:09     1.2
  +++ HyphenationTree.java      2001/06/07 21:02:01     1.3
  @@ -1,4 +1,4 @@
  -/** -- $Id: HyphenationTree.java,v 1.2 2001/06/07 20:30:09 tore Exp $ --
  +/** -- $Id: HyphenationTree.java,v 1.3 2001/06/07 21:02:01 tore Exp $ --
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -220,13 +220,13 @@
            char sp = word[i];
            p = root;
   
  -         while( p != 0 ) {
  +         while( p > 0 && p < sc.length){
               if (sc[p] == 0xFFFF) {
                  if ( hstrcmp(word, i, kv.getArray(), lo[p]) == 0 ) {
                     values = getValues(eq[p]);  // data pointer is in eq[]
                     int j=index;
                     for(int k=0; k<values.length; k++) {
  -                     if ( values[k] > il[j] )
  +                     if ( j < il.length && values[k] > il[j] )
                           il[j] = values[k];
                        j++;
                     }
  @@ -235,17 +235,19 @@
               }
               int d = sp - sc[p];
               if ( d == 0 ) {
  -               if ( sp == 0 )
  -                  break;
  +                if ( sp == 0 ) {
  +                    break;
  +                }
                  sp = word[++i];
                  p = eq[p];
                  q = p;
   
                  // look for a pattern ending at this position by searching for
                  // the null char ( splitchar == 0 )
  -               while ( q != 0 ) {
  -                  if ( sc[q] == 0xFFFF ) // stop at compressed branch
  +               while ( q > 0 && q < sc.length ) {
  +                  if ( sc[q] == 0xFFFF ) {// stop at compressed branch
                        break;
  +                  }
                     if ( sc[q] == 0 ) {
                        values = getValues(eq[q]);
                        int j=index;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to