From e4a2df9fec4859609106179715af54eed608a29f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 21 Apr 2014 18:11:47 +1000 Subject: View2d: check UI_view2d_view_to_region_clip succeeds before using the result --- source/blender/editors/space_node/node_select.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/space_node/node_select.c') diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index 63323f0e370..a304b5bab51 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -590,9 +590,8 @@ static bool do_lasso_select_node(bContext *C, const int mcords[][2], short moves BLI_rctf_cent_y(&node->totr)}; /* marker in screen coords */ - UI_view2d_view_to_region_clip(&ar->v2d, cent[0], cent[1], &screen_co[0], &screen_co[1]); - - if (BLI_rcti_isect_pt(&rect, screen_co[0], screen_co[1]) && + if (UI_view2d_view_to_region_clip(&ar->v2d, cent[0], cent[1], &screen_co[0], &screen_co[1]) && + BLI_rcti_isect_pt(&rect, screen_co[0], screen_co[1]) && BLI_lasso_is_point_inside(mcords, moves, screen_co[0], screen_co[1], INT_MAX)) { nodeSetSelected(node, select); -- cgit v1.2.3