diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2011-03-18 16:36:52 +0300 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2011-03-18 16:36:52 +0300 |
commit | b4743ccd8fdb577670d16ffdd6b3ad2132fa3fea (patch) | |
tree | cfbc3180eac504fe1d56d9f0ec33ee2cde863d13 /intern/ghost | |
parent | 879be45bb57c23e129f4b917b72d50fe05006400 (diff) |
Fix for crasher on Win XP, submitted by Kanttori.
size is 32 on XP, while sizeof(ri) gives 40. Pick the smaller one to pass to memcpy to prevent crashes.
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index e815430da7a..db6956de740 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -450,7 +450,7 @@ GHOST_TKey GHOST_SystemWin32::hardKey(GHOST_IWindow *window, WPARAM wParam, LPAR GetRawInputData((HRAWINPUT)lParam, RID_INPUT, data, &size, sizeof(RAWINPUTHEADER))) { RAWINPUT ri; - memcpy(&ri,data,sizeof(ri)); + memcpy(&ri,data,(size < sizeof(ri)) ? size : sizeof(ri)); if (ri.header.dwType == RIM_TYPEKEYBOARD) { |