vs2022 Debug mode error #3959
-
SVXPrimitiveDataArchive* pstMeshInArchive = CVxObjPrimitiveIn->GetPrimitiveArchive();
vxfloat3* pf3VertPos = pstMeshInArchive->GetVerticeDefinition(vxrVertexTypePOSITION);
vxmatrix matMeshOS2WS = *CVxObjPrimitiveIn->GetMatrixOS2WS();
Mesh temp = Mesh();
VertCoords vertCoords = temp.points;
for (int i = 0; i < pstMeshInArchive->uiNumVertice; i++)
{
vxfloat3 vertPos;
VXHMTransformPoint(&vertPos, &pf3VertPos[i], &matMeshOS2WS);
vertCoords.push_back(Vector3f(vertPos.x, vertPos.y, vertPos.z));
}
uint* uiIndices = new uint[pstMeshInArchive->uiNumIndice];
memcpy(uiIndices, pstMeshInArchive->puiIndexList, sizeof(uint)* pstMeshInArchive->uiNumIndice);
Triangulation indexList = temp.topology.getTriangulation();
for (int i = 0; i < pstMeshInArchive->uiNumPrimitives; i++)
{
indexList.push_back(ThreeVertIds{ VertId(uiIndices[i * 3 + 0]), VertId(uiIndices[i * 3 + 1]), VertId(uiIndices[i * 3 + 2]) });
}
temp = Mesh::fromTriangles(vertCoords, indexList);
pMeshOut = temp;
return true; The given code does not produce any errors in Release Mode, but in Debug Mode, an error occurs near the push_back operation. You'd like to understand the reason behind this behavior. Here's the translation of your query into English: In the following code, there is no error in Release Mode, but an error occurs near the push_back in Debug Mode. I want to know the reason for this. If you'd like, I can provide additional debugging tips or explanations! Let me know. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hello! Could you please provide more information about error you get, and what exact |
Beta Was this translation helpful? Give feedback.
-
As far as I can see, your program crashes in
and here there are no MeshLib calls actually. Most probably, you read out-of-range in
|
Beta Was this translation helpful? Give feedback.
As far as I can see, your program crashes in
and here there are no MeshLib calls actually.
Most probably, you read out-of-range in
uiIndices[i * 3 + 2]
. Please verify that