diff options
Diffstat (limited to 'src')
-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) |