mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 02:41:17 +00:00
Fix rare crash due to invalid pointer when vector::resize reallocate underlying memory (#15877)
This commit is contained in:
@@ -697,7 +697,8 @@ public:
|
||||
}
|
||||
} else {
|
||||
// Resize by duplicating the last value.
|
||||
this->values.resize(n, this->values./*back*/front());
|
||||
T v = this->values./*back*/front();
|
||||
this->values.resize(n, v);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -772,8 +773,10 @@ public:
|
||||
|
||||
if (this->values.empty())
|
||||
this->values.resize(rhs_vec->size());
|
||||
else
|
||||
this->values.resize(rhs_vec->size(), this->values.front());
|
||||
else {
|
||||
T v = this->values.front();
|
||||
this->values.resize(rhs_vec->size(), v);
|
||||
}
|
||||
|
||||
assert(default_index.size() == rhs_vec->size());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user