[ODE] RE: memory trashing bug in dcTriListCollider.cpp?
David McClurg
dmcclurg at pandemicstudios.com.au
Sun Jun 16 23:31:02 2002
When I increased my contact array size from 6 to 20, the crash went away (or moved :p). I'm hoping there is a incorrect/missing test somewhere since I'm passing in the size (N) of the contact array to dCollide().
static void NearCallback(void* data, dGeomID o1, dGeomID o2)
{
const U32 N = 20; // changed from 6 -> 20 and crash went away
dContact contacts[N];
// get the contacts up to a maximum of N contacts
const U32 n = dCollide(o1, o2, N, &contacts[0].geom, sizeof(dContact));
-----Original Message-----
From: David McClurg [mailto:dpm@efn.org]On Behalf Of David McClurg
Sent: Monday, 17 June 2002 4:16 PM
To: ode@q12.org
Subject: memory trashing bug in dcTriListCollider.cpp?
In dcTriListCollider::CollideBox(), I'm getting a memory overwrite around Line 158. I think the OutContact reference is past the end of the Contacts list. My Box is a "big" box if that matters at all. I think there is a missing test somewhere. Could someone who understand this code better shed any light on this?
if (Index == OutTriCount){
dContactGeom& OutContact = *CONTACT(Contacts, OutTriCount * Stride);