]> source.dussan.org Git - poi.git/commitdiff
bug#52560 - ArrayIndexOutOfBoundsException: -2 on NPOIFSFileSystem.readBAT
authorMaxim Valyanskiy <maxcom@apache.org>
Mon, 30 Jan 2012 12:55:29 +0000 (12:55 +0000)
committerMaxim Valyanskiy <maxcom@apache.org>
Mon, 30 Jan 2012 12:55:29 +0000 (12:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1237629 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java

index fbfd04d77a8828f2d13ebbeb8b66cfe71b6ff796..def2af198df364757b2e40b250a52e6a615cad14 100644 (file)
@@ -369,7 +369,7 @@ public class NPOIFSFileSystem extends BlockStore
           
           for(int j=0; j<bigBlockSize.getXBATEntriesPerBlock(); j++) {
              int fatAt = xfat.getValueAt(j);
-             if(fatAt == POIFSConstants.UNUSED_BLOCK) break;
+             if(fatAt == POIFSConstants.UNUSED_BLOCK || fatAt == POIFSConstants.END_OF_CHAIN) break;
              readBAT(fatAt, loopDetector);
           }
        }