FIX: array out of bounds

when slice one filament with multi_extruder printer
jira: none

Change-Id: Ic8deeb7df9c428e97bf904532362180fc1fd6738
(cherry picked from commit feb9b02067b2e4bbdba7ba429531d4fd6081913c)
This commit is contained in:
zhimin.zeng 2024-12-09 20:20:42 +08:00 committed by Noisyfox
parent 660d2ee686
commit 31b65dfbe9

View file

@ -602,6 +602,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
@ -610,7 +612,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];