check for corrupted memory

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8852 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: a6030373e29004c00aefd168666b90c01995850a
Former-commit-id: f550d5fc15104ce0dbc6c0fd050ecebf1e0a8bfa
This commit is contained in:
iobyte 2023-03-30 04:20:59 +00:00
parent 423061c646
commit 3fb45ee8dc

View file

@ -425,6 +425,8 @@ static void SimCarWallCollideResponse(void *clientdata, DtObjectRef obj1, DtObje
if (carElt == nullptr)
GfFatal("SimCarWallCollideResponse: car->carElt (null)\n");
else if (carElt->index < 0 || carElt->index > 100)
GfFatal("SimCarWallCollideResponse: carElt->index (%d)\n", carElt->index);
sgVec2 vp; // Speed of car collision point in global frame of reference.
sgVec2 rg; // raduis oriented in global coordinates, still relative to CG (rotated aroung CG).