[Bf-blender-cvs] [675a22b3415] master: Nodes: fix link drawing for some socket types

Jacques Lucke noreply at git.blender.org
Fri Oct 22 11:56:42 CEST 2021


Commit: 675a22b3415919740d7adc01d823b9507e30a918
Author: Jacques Lucke
Date:   Fri Oct 22 11:52:51 2021 +0200
Branches: master
https://developer.blender.org/rB675a22b3415919740d7adc01d823b9507e30a918

Nodes: fix link drawing for some socket types

The type of sockets is `-1` in some cases, resulting in a crash
when accessing the `std_node_socket_colors` array.

===================================================================

M	source/blender/editors/space_node/drawnode.cc

===================================================================

diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc
index 7bb35ab37d5..5117544aba8 100644
--- a/source/blender/editors/space_node/drawnode.cc
+++ b/source/blender/editors/space_node/drawnode.cc
@@ -4262,7 +4262,9 @@ void node_draw_link_bezier(const View2D *v2d,
     }
 
     if (snode->overlay.flag & SN_OVERLAY_SHOW_OVERLAYS &&
-        snode->overlay.flag & SN_OVERLAY_SHOW_WIRE_COLORS) {
+        snode->overlay.flag & SN_OVERLAY_SHOW_WIRE_COLORS &&
+        ((link->fromsock == nullptr || link->fromsock->typeinfo->type >= 0) &&
+         (link->tosock == nullptr || link->tosock->typeinfo->type >= 0))) {
       if (link->fromsock) {
         copy_v4_v4(colors[1], std_node_socket_colors[link->fromsock->typeinfo->type]);
       }



More information about the Bf-blender-cvs mailing list