summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2014-05-09 18:30:47 +0200
committerworktycho <work.tycho@gmail.com>2014-05-09 18:30:47 +0200
commit99af4453ef832c4053fa26e6ed9f64804bce110a (patch)
treeeaaae205a7656a0d14baad89be3393bf40ee6d95
parentInitialise m_HasTeleported in both constructors (diff)
downloadcuberite-99af4453ef832c4053fa26e6ed9f64804bce110a.tar
cuberite-99af4453ef832c4053fa26e6ed9f64804bce110a.tar.gz
cuberite-99af4453ef832c4053fa26e6ed9f64804bce110a.tar.bz2
cuberite-99af4453ef832c4053fa26e6ed9f64804bce110a.tar.lz
cuberite-99af4453ef832c4053fa26e6ed9f64804bce110a.tar.xz
cuberite-99af4453ef832c4053fa26e6ed9f64804bce110a.tar.zst
cuberite-99af4453ef832c4053fa26e6ed9f64804bce110a.zip
Diffstat (limited to '')
-rw-r--r--src/WorldStorage/MapSerializer.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/WorldStorage/MapSerializer.cpp b/src/WorldStorage/MapSerializer.cpp
index df72d1cc9..012fc52f3 100644
--- a/src/WorldStorage/MapSerializer.cpp
+++ b/src/WorldStorage/MapSerializer.cpp
@@ -152,6 +152,10 @@ bool cMapSerializer::LoadMapFromNBT(const cParsedNBT & a_NBT)
if (CurrLine >= 0)
{
unsigned int Width = a_NBT.GetShort(CurrLine);
+ if (Width != 128)
+ {
+ return false;
+ }
m_Map->m_Width = Width;
}
@@ -159,6 +163,10 @@ bool cMapSerializer::LoadMapFromNBT(const cParsedNBT & a_NBT)
if (CurrLine >= 0)
{
unsigned int Height = a_NBT.GetShort(CurrLine);
+ if (Height >= 256)
+ {
+ return false;
+ }
m_Map->m_Height = Height;
}