FIX: array out of bounds

when slice one filament with multi_extruder printer
jira: none

Change-Id: Ic8deeb7df9c428e97bf904532362180fc1fd6738
This commit is contained in:
zhimin.zeng 2024-12-09 20:20:42 +08:00 committed by lane.wei
parent a8d25d48f7
commit feb9b02067
1 changed files with 3 additions and 1 deletions

View File

@ -705,6 +705,8 @@ public:
if (cnt < 1)
return false;
std::vector<T> default_value = this->values;
if (this->values.empty())
this->values.resize(rhs_vec->size());
else
@ -713,7 +715,7 @@ public:
assert(default_index.size() == rhs_vec->size());
bool modified = false;
std::vector<T> default_value = this->values;
for (size_t i = 0; i < rhs_vec->size(); ++i) {
if (!rhs_vec->is_nil(i)) {
this->values[i] = rhs_vec->values[i];