Fix [#23569] Convex hull bounds crash Blender

Reported by dobz116

This appears to happen only on 64bit Windows. An issue for this part of code was
reported at http://code.google.com/p/bullet/issues/detail?id=204 and fixed at
http://code.google.com/p/bullet/source/detail?r=1650 . The code change also fixes
the crash we experience: merged changes.
This commit is contained in:
Nathan Letwory 2010-09-03 05:18:36 +00:00
parent a8269c8946
commit d5ddc9eadb

@ -24,12 +24,13 @@ btConvexHullShape ::btConvexHullShape (const btScalar* points,int numPoints,int
m_shapeType = CONVEX_HULL_SHAPE_PROXYTYPE;
m_unscaledPoints.resize(numPoints);
unsigned char* pointsBaseAddress = (unsigned char*)points;
unsigned char* pointsAddress = (unsigned char*)points;
for (int i=0;i<numPoints;i++)
{
btVector3* point = (btVector3*)(pointsBaseAddress + i*stride);
m_unscaledPoints[i] = point[0];
btScalar* point = (btScalar*)pointsAddress;
m_unscaledPoints[i] = btVector3(point[0], point[1], point[2]);
pointsAddress += stride;
}
recalcLocalAabb();