diff options
author | madmaxoft <github@xoft.cz> | 2014-06-09 00:49:02 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-06-09 00:49:02 +0200 |
commit | ec0976f9b0ace946022f48fdb360830985e7ee14 (patch) | |
tree | 2e7e540a0b8d202c69361e7410e524dcc87e2359 | |
parent | Fixed deadlock when moving players to other worlds. (diff) | |
download | cuberite-ec0976f9b0ace946022f48fdb360830985e7ee14.tar cuberite-ec0976f9b0ace946022f48fdb360830985e7ee14.tar.gz cuberite-ec0976f9b0ace946022f48fdb360830985e7ee14.tar.bz2 cuberite-ec0976f9b0ace946022f48fdb360830985e7ee14.tar.lz cuberite-ec0976f9b0ace946022f48fdb360830985e7ee14.tar.xz cuberite-ec0976f9b0ace946022f48fdb360830985e7ee14.tar.zst cuberite-ec0976f9b0ace946022f48fdb360830985e7ee14.zip |
-rw-r--r-- | src/BlockArea.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp index e3a859e4f..4fe6cd51e 100644 --- a/src/BlockArea.cpp +++ b/src/BlockArea.cpp @@ -309,6 +309,14 @@ void cBlockArea::Clear(void) void cBlockArea::Create(int a_SizeX, int a_SizeY, int a_SizeZ, int a_DataTypes) { + if ((a_SizeX < 0) || (a_SizeY < 0) || (a_SizeZ < 0)) + { + LOGWARNING("Creating a cBlockArea with a negative size! Call to Create ignored. (%d, %d, %d)", + a_SizeX, a_SizeY, a_SizeZ + ); + return; + } + Clear(); int BlockCount = a_SizeX * a_SizeY * a_SizeZ; if ((a_DataTypes & baTypes) != 0) |