diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2006-05-10 19:21:39 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2006-05-10 19:21:39 +0000 |
commit | 1e7d84e258a006f1509de9f41c1bffc985dfb450 (patch) | |
tree | b1a6748713e6811f267d4e2ab3367828031bcc35 /src/glut/glx/glut_event.c | |
parent | 700359ca5a9989e08739ff1a74e4806736bce99b (diff) |
move check for event.xbutton.button <= GLUT_MAX_MENUS (see sf bug 1484284)
Diffstat (limited to 'src/glut/glx/glut_event.c')
-rw-r--r-- | src/glut/glx/glut_event.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/glut/glx/glut_event.c b/src/glut/glx/glut_event.c index f997f772c7..4e67da674e 100644 --- a/src/glut/glx/glut_event.c +++ b/src/glut/glx/glut_event.c @@ -439,11 +439,15 @@ processEventsAndTimeouts(void) } else { window = __glutGetWindow(event.xbutton.window); /* added button check for mice with > 3 buttons */ - if (window && event.xbutton.button <= GLUT_MAX_MENUS) { + if (window) { GLUTmenu *menu; int menuNum; - menuNum = window->menu[event.xbutton.button - 1]; + if (event.xbutton.button <= GLUT_MAX_MENUS) + menuNum = window->menu[event.xbutton.button - 1]; + else + menuNum = 0; + /* Make sure that __glutGetMenuByNum is only called if there really is a menu present. */ if ((menuNum > 0) && (menu = __glutGetMenuByNum(menuNum))) { |