diff --git a/include/assimp/mesh.h b/include/assimp/mesh.h index 26084c77e..df257e7f1 100644 --- a/include/assimp/mesh.h +++ b/include/assimp/mesh.h @@ -160,8 +160,13 @@ struct aiFace delete[] mIndices; mNumIndices = o.mNumIndices; - mIndices = new unsigned int[mNumIndices]; - ::memcpy( mIndices, o.mIndices, mNumIndices * sizeof( unsigned int)); + if (mNumIndices) { + mIndices = new unsigned int[mNumIndices]; + ::memcpy( mIndices, o.mIndices, mNumIndices * sizeof( unsigned int)); + } + else { + mIndices = NULL; + } return *this; }