Fix possible bullet crash
This commit is contained in:
parent
1ea75b5f0e
commit
10e7ac603f
@ -176,16 +176,16 @@ int btPersistentManifold::addManifoldPoint(const btManifoldPoint& newPoint)
|
||||
#else
|
||||
insertIndex = 0;
|
||||
#endif
|
||||
if (insertIndex < 0 || insertIndex >= MANIFOLD_CACHE_SIZE)
|
||||
insertIndex = 0;
|
||||
clearUserCache(m_pointCache[insertIndex]);
|
||||
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
m_cachedPoints++;
|
||||
|
||||
|
||||
if (insertIndex < 0 || insertIndex >= MANIFOLD_CACHE_SIZE)
|
||||
insertIndex = 0;
|
||||
}
|
||||
if (insertIndex<0)
|
||||
insertIndex=0;
|
||||
|
||||
btAssert(m_pointCache[insertIndex].m_userPersistentData==0);
|
||||
m_pointCache[insertIndex] = newPoint;
|
||||
|
@ -422,6 +422,8 @@ void btPolyhedralContactClipping::clipHullAgainstHull(const btVector3& separatin
|
||||
}
|
||||
}
|
||||
}
|
||||
if (closestFaceB == -1 || closestFaceB >= hullB.m_faces.size())
|
||||
return;
|
||||
btVertexArray worldVertsB1;
|
||||
{
|
||||
const btFace& polyB = hullB.m_faces[closestFaceB];
|
||||
|
Loading…
x
Reference in New Issue
Block a user