Fix crash opening specific files

For some reason socket flag and actual presence of link got out of sync.
Check for link to be present prior to access it.

Fixes crash opening file from T48684.
This commit is contained in:
Sergey Sharybin 2020-01-06 11:52:35 +01:00
parent 9483997472
commit a6d01365e3
1 changed files with 1 additions and 1 deletions

View File

@ -1219,7 +1219,7 @@ static void update_noise_and_wave_distortion(bNodeTree *ntree)
bNodeSocket *sockDistortion = nodeFindSocket(node, SOCK_IN, "Distortion");
float *distortion = cycles_node_socket_float_value(sockDistortion);
if (socket_is_used(sockDistortion)) {
if (socket_is_used(sockDistortion) && sockDistortion->link != NULL) {
bNode *distortionInputNode = sockDistortion->link->fromnode;
bNodeSocket *distortionInputSock = sockDistortion->link->fromsock;