Fixed memory allocation in detail mesh and memcpy in polymesh copy

This commit is contained in:
Mikko Mononen
2014-06-24 15:23:53 +03:00
parent eacaa87d9a
commit 480f56e94d
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1217,7 +1217,7 @@ bool rcBuildPolyMeshDetail(rcContext* ctx, const rcPolyMesh& mesh, const rcCompa
return false;
}
dmesh.ntris = 0;
dmesh.tris = (unsigned char*)rcAlloc(sizeof(unsigned char*)*tcap*4, RC_ALLOC_PERM);
dmesh.tris = (unsigned char*)rcAlloc(sizeof(unsigned char)*tcap*4, RC_ALLOC_PERM);
if (!dmesh.tris)
{
ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'dmesh.tris' (%d).", tcap*4);