Skip to content

Commit d3ea16e

Browse files
committed
Skip chunks with zero sector length in ChunkRegion
1 parent 1bfb443 commit d3ea16e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎src/main/java/org/glavo/nbt/chunk/ChunkRegion.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ static ChunkRegion readRegion(RawDataReader rawReader) throws IOException {
4545
assert rawReader.position() == fileStart + 2 * ChunkUtils.SECTOR_BYTES;
4646

4747
for (int localIndex : header.localIndexesSortedByOffset) {
48+
if (header.getSectorLengthBytes(localIndex) == 0) {
49+
continue;
50+
}
51+
4852
long sectorStart = fileStart + header.getSectorOffsetBytes(localIndex);
4953
long position = rawReader.position();
5054
if (position != sectorStart) {

0 commit comments

Comments
 (0)