diff options
-rw-r--r-- | src/BlockArea.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp index 40cca8882..49c564ca5 100644 --- a/src/BlockArea.cpp +++ b/src/BlockArea.cpp @@ -663,8 +663,12 @@ void cBlockArea::Merge(const cBlockArea & a_Src, int a_RelX, int a_RelY, int a_R if (IsDummyMetas) { - SrcMetas = new NIBBLETYPE[a_Src.GetBlockCount()]; - DstMetas = new NIBBLETYPE[GetBlockCount()]; + size_t SrcCount = a_Src.GetBlockCount(); + size_t DestCount = GetBlockCount(); + SrcMetas = new NIBBLETYPE[SrcCount]; + DstMetas = new NIBBLETYPE[DestCount]; + memset(SrcMetas, 0, SrcCount); + memset(DstMetas, 0, DestCount); } switch (a_Strategy) |