Don't cast memory XML attribute to int prematurely.
PiperOrigin-RevId: 479910328 Change-Id: I40a210852eeced75871361eb6531169ad0f79b6a
This commit is contained in:
committed by
Copybara-Service
parent
1a393429ef
commit
b2159a8e35
@@ -1070,7 +1070,7 @@ void mjXReader::Size(XMLElement* section, mjCModel* mod) {
|
|||||||
if (*memory / sizeof(mjtNum) > std::numeric_limits<int>::max()) {
|
if (*memory / sizeof(mjtNum) > std::numeric_limits<int>::max()) {
|
||||||
throw mjXError(section, err_msg);
|
throw mjXError(section, err_msg);
|
||||||
}
|
}
|
||||||
mod->memory = static_cast<int>(*memory);
|
mod->memory = *memory;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user