Don't accept NaN geom sizes.

PiperOrigin-RevId: 542209911
Change-Id: I80f9728e8e624d19783370ba5072f39624c1bbe7
This commit is contained in:
Nimrod Gileadi
2023-06-21 04:01:50 -07:00
committed by Copybara-Service
parent 516c5a8bbe
commit 74747e2ae6
2 changed files with 26 additions and 0 deletions
+5
View File
@@ -1717,6 +1717,11 @@ void mjCGeom::Compile(void) {
size[2] = mjMAX(fabs(aabb[2]), fabs(aabb[5]));
}
for (double s : size) {
if (std::isnan(s)) {
throw mjCError(this, "nan size in geom '%s' (id = %d)", name.c_str(), id);
}
}
// compute aabb
ComputeAABB();