Don't cast memory XML attribute to int prematurely.

PiperOrigin-RevId: 479910328
Change-Id: I40a210852eeced75871361eb6531169ad0f79b6a
This commit is contained in:
Saran Tunyasuvunakool
2022-10-09 06:01:55 -07:00
committed by Copybara-Service
parent 1a393429ef
commit b2159a8e35
+1 -1
View File
@@ -1070,7 +1070,7 @@ void mjXReader::Size(XMLElement* section, mjCModel* mod) {
if (*memory / sizeof(mjtNum) > std::numeric_limits<int>::max()) {
throw mjXError(section, err_msg);
}
mod->memory = static_cast<int>(*memory);
mod->memory = *memory;
}
}