diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-04-02 12:33:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-04-02 12:33:45 +0400 |
commit | da39179afd3e66caef8d0d29b67291c7d71af0dc (patch) | |
tree | 4e3966f8d25a0300bca9aa6cc80474307af77b1b | |
parent | 941a8a25040b8fdce1ac0fbe11e6391e06b79c17 (diff) |
[#17963] NearSensor segmentation fault
bugfix in bullet
Caused by using the index from closestAxis4 before checking its -1
-rw-r--r-- | extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp b/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp index d4e29882d37..eecf927ee10 100644 --- a/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp +++ b/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp @@ -172,6 +172,9 @@ int btPersistentManifold::addManifoldPoint(const btManifoldPoint& newPoint) #if MANIFOLD_CACHE_SIZE >= 4 //sort cache so best points come first, based on area insertIndex = sortCachedPoints(newPoint); + + if (insertIndex<0) + insertIndex=0; #else insertIndex = 0; #endif @@ -180,11 +183,7 @@ int btPersistentManifold::addManifoldPoint(const btManifoldPoint& newPoint) } else { m_cachedPoints++; - - } - if (insertIndex<0) - insertIndex=0; btAssert(m_pointCache[insertIndex].m_userPersistentData==0); m_pointCache[insertIndex] = newPoint; |