Fix #36080: fix cycles crash with certain group node setups, accessing freed

memory.
This commit is contained in:
Brecht Van Lommel
2013-07-10 10:50:19 +00:00
parent 5e1d450b90
commit 9460d9f344

View File

@@ -347,8 +347,9 @@ void ShaderGraph::remove_unneeded_nodes()
if(tonode->special_type == SHADER_SPECIAL_TYPE_AUTOCONVERT) { if(tonode->special_type == SHADER_SPECIAL_TYPE_AUTOCONVERT) {
bool all_links_removed = true; bool all_links_removed = true;
vector<ShaderInput*> links = tonode->outputs[0]->links;
foreach(ShaderInput *autoin, tonode->outputs[0]->links) { foreach(ShaderInput *autoin, links) {
if(autoin->default_value == ShaderInput::NONE) if(autoin->default_value == ShaderInput::NONE)
all_links_removed = false; all_links_removed = false;
else else