Fixed an access after free in ShaderLanguage::_reduce_expression.
Passing an element reference of a vector to a push_back call to that same vector can cause an access after free. This is because push_back will resize the vector, reallocating if necessary, leaving the reference referring to the freed memory. Removed an instance of this usage here.
This commit is contained in:
parent
9c2986abda
commit
bff864818f
|
@ -3437,8 +3437,9 @@ ShaderLanguage::Node *ShaderLanguage::_reduce_expression(BlockNode *p_block, Sha
|
|||
}
|
||||
}
|
||||
} else {
|
||||
ConstantNode::Value value = values[0];
|
||||
for (int i = 1; i < cardinality; i++) {
|
||||
values.push_back(values[0]);
|
||||
values.push_back(value);
|
||||
}
|
||||
}
|
||||
} else if (values.size() != cardinality) {
|
||||
|
|
Loading…
Reference in New Issue