Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenkernel/intern/navmesh_conversion.c4
-rw-r--r--source/gameengine/Ketsji/KX_NavMeshObject.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/navmesh_conversion.c b/source/blender/blenkernel/intern/navmesh_conversion.c
index e3b5b83964e..e6749730fc9 100644
--- a/source/blender/blenkernel/intern/navmesh_conversion.c
+++ b/source/blender/blenkernel/intern/navmesh_conversion.c
@@ -344,7 +344,7 @@ int buildNavMeshData(const int nverts, const float* verts,
int *vertsPerPoly_r, int **dtrisToPolysMap_r, int **dtrisToTrisMap_r)
{
- int *trisMapping = MEM_callocN(sizeof(int)*ntris, "buildNavMeshData trisMapping");
+ int *trisMapping;
int i;
struct SortContext context;
int validTriStart, prevPolyIdx, curPolyIdx, newPolyIdx, prevpolyidx;
@@ -360,6 +360,8 @@ int buildNavMeshData(const int nverts, const float* verts,
return 0;
}
+ trisMapping = MEM_callocN(sizeof(int)*ntris, "buildNavMeshData trisMapping");
+
//sort the triangles by polygon idx
for (i=0; i<ntris; i++)
trisMapping[i]=i;
diff --git a/source/gameengine/Ketsji/KX_NavMeshObject.cpp b/source/gameengine/Ketsji/KX_NavMeshObject.cpp
index 6765f07b344..f92319e508b 100644
--- a/source/gameengine/Ketsji/KX_NavMeshObject.cpp
+++ b/source/gameengine/Ketsji/KX_NavMeshObject.cpp
@@ -248,7 +248,7 @@ bool KX_NavMeshObject::BuildVertIndArrays(float *&vertices, int& nverts,
}
//create tris
- polys = new unsigned short[npolys*3*2];
+ polys = (unsigned short*)MEM_callocN(sizeof(unsigned short)*3*2*npolys, "BuildVertIndArrays polys");
memset(polys, 0xff, sizeof(unsigned short)*3*2*npolys);
unsigned short *poly = polys;
RAS_Polygon* raspoly;