From ad33c033d12e3b0b2b2cc0c8520f241f86cef060 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 19 Aug 2009 00:40:29 -0400 Subject: [PATCH] Fixed buffer overrun (misunderstanding about input system). --- Source/OpenGL_Windows.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index 1588b64..f42de33 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -468,17 +468,10 @@ static void sdlEventProc(const SDL_Event &e, Game &game) case SDL_MOUSEBUTTONDOWN: { val = clamp_sdl_mouse_button(e.button.button); - if (val >= 0) + if ((val >= 0) && (val <= 2)) { if (val == 0) - { g_button = true; - SetKey(MAC_MOUSEBUTTON1); - } - - else if (val == 1) - SetKey(MAC_MOUSEBUTTON2); - buttons[val] = true; } } @@ -487,17 +480,10 @@ static void sdlEventProc(const SDL_Event &e, Game &game) case SDL_MOUSEBUTTONUP: { val = clamp_sdl_mouse_button(e.button.button); - if (val >= 0) + if ((val >= 0) && (val <= 2)) { if (val == 0) - { g_button = false; - ClearKey(MAC_MOUSEBUTTON1); - } - - else if (val == 1) - ClearKey(MAC_MOUSEBUTTON2); - buttons[val] = false; } } -- 2.39.5