diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-06-11 16:56:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-06-11 16:58:53 +0300 |
commit | 356afe0085718cd326f4e830c943537923c2e976 (patch) | |
tree | 1981fcef3b2db810509e9b3cd75674e7d7c98000 /source/blender/windowmanager | |
parent | 6a0a205cb4f648144729de98b39b91d44bf13752 (diff) |
Fix possible NULL pointer use
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 889a36b6953..b1fe4bf1685 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1137,7 +1137,10 @@ static int wm_operator_invoke( int bounds[4] = {-1, -1, -1, -1}; bool wrap; - if (op->opm) { + if (event == NULL) { + wrap = false; + } + else if (op->opm) { wrap = (U.uiflag & USER_CONTINUOUS_MOUSE) && ((op->opm->flag & OP_IS_MODAL_GRAB_CURSOR) || (op->opm->type->flag & OPTYPE_GRAB_CURSOR)); } @@ -1159,7 +1162,7 @@ static int wm_operator_invoke( ARegion *ar = CTX_wm_region(C); ScrArea *sa = CTX_wm_area(C); - if (ar && ar->regiontype == RGN_TYPE_WINDOW && event && + if (ar && ar->regiontype == RGN_TYPE_WINDOW && BLI_rcti_isect_pt_v(&ar->winrct, &event->x)) { winrect = &ar->winrct; |