diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-21 12:11:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-21 12:11:47 +0400 |
commit | e4a2df9fec4859609106179715af54eed608a29f (patch) | |
tree | d5d8302b5d7ad2fa69c229a0f18fcc1d90e78427 /source/blender/editors/space_clip/clip_graph_ops.c | |
parent | 9ae0e585b0aab466c978ec1a55c824d902faa3b4 (diff) |
View2d: check UI_view2d_view_to_region_clip succeeds before using the result
Diffstat (limited to 'source/blender/editors/space_clip/clip_graph_ops.c')
-rw-r--r-- | source/blender/editors/space_clip/clip_graph_ops.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/space_clip/clip_graph_ops.c b/source/blender/editors/space_clip/clip_graph_ops.c index 074d76c1a41..8596c8fb19a 100644 --- a/source/blender/editors/space_clip/clip_graph_ops.c +++ b/source/blender/editors/space_clip/clip_graph_ops.c @@ -193,10 +193,10 @@ static bool mouse_select_knot(bContext *C, float co[2], bool extend) if (userdata.marker) { int x1, y1, x2, y2; - UI_view2d_view_to_region_clip(v2d, co[0], co[1], &x1, &y1); - UI_view2d_view_to_region_clip(v2d, userdata.min_co[0], userdata.min_co[1], &x2, &y2); - - if (abs(x2 - x1) <= delta && abs(y2 - y1) <= delta) { + if (UI_view2d_view_to_region_clip(v2d, co[0], co[1], &x1, &y1) && + UI_view2d_view_to_region_clip(v2d, userdata.min_co[0], userdata.min_co[1], &x2, &y2) && + (abs(x2 - x1) <= delta && abs(y2 - y1) <= delta)) + { if (!extend) { SelectUserData selectdata = {SEL_DESELECT}; |