Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-03-09 11:45:18 +0300
committerJacques Lucke <jacques@blender.org>2021-03-09 11:45:18 +0300
commit07a9d39f57093c886fe64b02006cae26193eb8aa (patch)
tree1b062e367ec4a937c5811a3dc0dd2b685dc71424 /source/blender/nodes/NOD_geometry_exec.hh
parentdc3e9048aef7205376295e4887c589bb4bc319d0 (diff)
Fix: unconnected multi socket input crashes
The crash would only happen when the output of the Join Geometry node is used.
Diffstat (limited to 'source/blender/nodes/NOD_geometry_exec.hh')
-rw-r--r--source/blender/nodes/NOD_geometry_exec.hh16
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/nodes/NOD_geometry_exec.hh b/source/blender/nodes/NOD_geometry_exec.hh
index 1772f92c4b6..5b123e68fe2 100644
--- a/source/blender/nodes/NOD_geometry_exec.hh
+++ b/source/blender/nodes/NOD_geometry_exec.hh
@@ -120,13 +120,17 @@ class GeoNodeExecParams {
template<typename T> Vector<T> extract_multi_input(StringRef identifier)
{
Vector<T> values;
- values.append(input_values_.extract<T>(identifier));
- int i = 1;
- std::string sub_identifier = identifier + "[1]";
- while (input_values_.contains(sub_identifier)) {
+ int index = 0;
+ while (true) {
+ std::string sub_identifier = identifier;
+ if (index > 0) {
+ sub_identifier += "[" + std::to_string(index) + "]";
+ }
+ if (!input_values_.contains(sub_identifier)) {
+ break;
+ }
values.append(input_values_.extract<T>(sub_identifier));
- i++;
- sub_identifier = identifier + "[" + std::to_string(i) + "]";
+ index++;
}
return values;
}