From a2b1fa6520355e9f073fcb44897c6ee21a69df75 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 27 Apr 2014 13:12:36 -0700 Subject: Initialised MetaArrays in BlockArea Fixes CID 43621 --- src/BlockArea.cpp | 8 ++++++-- 1 file 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) -- cgit v1.2.3