diff --git a/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java b/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java index def2af198..d2e399794 100644 --- a/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java +++ b/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java @@ -356,6 +356,9 @@ public class NPOIFSFileSystem extends BlockStore readBAT(fatAt, loopDetector); } + // Work out how many FAT blocks remain in the XFATs + int remainingFATs = _header.getBATCount() - _header.getBATArray().length; + // Now read the XFAT blocks, and the FATs within them BATBlock xfat; int nextAt = _header.getXBATIndex(); @@ -367,11 +370,14 @@ public class NPOIFSFileSystem extends BlockStore nextAt = xfat.getValueAt(bigBlockSize.getXBATEntriesPerBlock()); _xbat_blocks.add(xfat); - for(int j=0; j