lianlab / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

bad pointer in btCompoundShape::addChildShape(), Fix proposed #171

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There is a bug in btCompoundShape::addChildShape(): the child element is
added to the m_children list before the m_node member is set. As a result,
the m_node pointer is uninitialized in the copy stored in m_children.
This has no effect until the btCompoundShape::removeChildShapeByIndex() is
used to remove that child shape => crash when the node is removed from the
dynamic AaBb tree.

The fix is simple: just postpone the m_children.push_back() statement after
child.m_node is initialized.

Original issue reported on code.google.com by benoitbo...@gmail.com on 13 Jan 2009 at 10:15

Attachments:

GoogleCodeExporter commented 9 years ago

Indeed, that was a bug.

It has been fixed in the latest trunk:
http://code.google.com/p/bullet/source/detail?r=1586

Thanks a lot for the report and fix!
Erwin

Original comment by erwin.coumans on 19 Jan 2009 at 7:33