mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
RegionLoader: account for possible corrupted header pointing to itself
This commit is contained in:
parent
b92a2ded8a
commit
b559a65346
@ -277,8 +277,11 @@ class RegionLoader{
|
|||||||
|
|
||||||
if($offset === 0 or $sectorCount === 0){
|
if($offset === 0 or $sectorCount === 0){
|
||||||
$this->locationTable[$i] = null;
|
$this->locationTable[$i] = null;
|
||||||
|
}elseif($offset >= self::FIRST_SECTOR){
|
||||||
|
$this->bumpNextFreeSector($this->locationTable[$i] = new RegionLocationTableEntry($offset, $sectorCount, $timestamp));
|
||||||
}else{
|
}else{
|
||||||
$this->bumpNextFreeSector($this->locationTable[$i] = new RegionLocationTableEntry($offset, $index & 0xff, $timestamp));
|
self::getChunkCoords($i, $chunkXX, $chunkZZ);
|
||||||
|
throw new CorruptedRegionException("Invalid region header entry for x=$chunkXX z=$chunkZZ, offset overlaps with header");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user