Prevent visualization of SDF iterations from writing outside the maximum allocated vector. Fixes #1539.
PiperOrigin-RevId: 632071103 Change-Id: Idf91ede1661e717ad338f601a5482ab171d7f625
This commit is contained in:
committed by
Copybara-Service
parent
d6bc8c7781
commit
1d181786a2
+1
-1
@@ -38,7 +38,7 @@ SdfVisualizer::SdfVisualizer() {
|
||||
}
|
||||
|
||||
void SdfVisualizer::AddPoint(const mjtNum point[3]) {
|
||||
if (!npoints_.empty()) {
|
||||
if (!npoints_.empty() && npoints_.back() < points_.size()/3) {
|
||||
points_[3*npoints_.back()+0] = point[0];
|
||||
points_[3*npoints_.back()+1] = point[1];
|
||||
points_[3*npoints_.back()+2] = point[2];
|
||||
|
||||
Reference in New Issue
Block a user