Remove unconditional mj_markStack in mjv_addGeoms.
Prior to commit 3f855f32d9, calling `mjv_updateScene` and `mjv_updateSceneFromState` on an "empty" `mjData` (one without a buffer but where all sizes are also zero) was a valid operation. The `mj_markStack` call requires free stack space, so a call to `mjv_addGeoms` on an empty `mjData` results in a stack overflow whenever `mjVIS_TENDON` is enabled.
Fixes #2305.
PiperOrigin-RevId: 713418586
Change-Id: I99b5de23fe94ba9aa86eeef0700c891976c9aecc
This commit is contained in:
committed by
Copybara-Service
parent
f912e8df16
commit
357ea024c0
@@ -1728,7 +1728,7 @@ void mjv_addGeoms(const mjModel* m, mjData* d, const mjvOption* vopt,
|
||||
// spatial tendons
|
||||
objtype = mjOBJ_TENDON;
|
||||
category = mjCAT_DYNAMIC;
|
||||
if (vopt->flags[mjVIS_TENDON] && (category & catmask)) {
|
||||
if (vopt->flags[mjVIS_TENDON] && (category & catmask) && m->ntendon) {
|
||||
// mark actuated tendons
|
||||
mj_markStack(d);
|
||||
int* tendon_actuated = mjSTACKALLOC(d, m->ntendon, int);
|
||||
|
||||
Reference in New Issue
Block a user