From 430b614a69612cea970fd5603b6ab70dffc708ab Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 8 Jan 2016 16:18:32 +0100 Subject: [PATCH] coverity scan: make place of false positive more understandable. --- code/MakeVerboseFormat.cpp | 3 ++- include/assimp/mesh.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/MakeVerboseFormat.cpp b/code/MakeVerboseFormat.cpp index 62c7d9f..451a616 100644 --- a/code/MakeVerboseFormat.cpp +++ b/code/MakeVerboseFormat.cpp @@ -174,7 +174,8 @@ bool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh* pcMesh) delete pcMesh->mBones[i]->mWeights; if (!newWeights[i].empty()) { pcMesh->mBones[i]->mWeights = new aiVertexWeight[newWeights[i].size()]; - memcpy(pcMesh->mBones[i]->mWeights, &newWeights[i][0], + aiVertexWeight *weightToCopy = &( newWeights[i][0] ); + memcpy(pcMesh->mBones[i]->mWeights, weightToCopy, sizeof(aiVertexWeight) * newWeights[i].size()); delete[] newWeights; } else { diff --git a/include/assimp/mesh.h b/include/assimp/mesh.h index 00cc31d..f112bea 100644 --- a/include/assimp/mesh.h +++ b/include/assimp/mesh.h @@ -249,7 +249,8 @@ struct aiBone //! Default constructor aiBone() - : mNumWeights( 0 ) + : mName() + , mNumWeights( 0 ) , mWeights( NULL ) { } -- 2.7.4