From 6730d4dddaa48d012031af168fc65e506bda64b5 Mon Sep 17 00:00:00 2001 From: CharlesJClark Date: Fri, 19 Jun 2015 09:33:27 -0700 Subject: [PATCH] Update RecastMesh.cpp Fixed validation checks of allocations. --- Recast/Source/RecastMesh.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Recast/Source/RecastMesh.cpp b/Recast/Source/RecastMesh.cpp index 51634c7..c885344 100644 --- a/Recast/Source/RecastMesh.cpp +++ b/Recast/Source/RecastMesh.cpp @@ -837,7 +837,7 @@ static bool removeVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short } rcScopedDelete thole = (int*)rcAlloc(sizeof(int)*nhole, RC_ALLOC_TEMP); - if (!tverts) + if (!thole) { ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'thole' (%d).", nhole); return false; @@ -876,7 +876,7 @@ static bool removeVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short return false; } rcScopedDelete pareas = (unsigned char*)rcAlloc(sizeof(unsigned char)*ntris, RC_ALLOC_TEMP); - if (!pregs) + if (!pareas) { ctx->log(RC_LOG_ERROR, "removeVertex: Out of memory 'pareas' (%d).", ntris); return false;