Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorNathan Letwory <nathan@letworyinteractive.com>2011-03-18 16:36:52 +0300
committerNathan Letwory <nathan@letworyinteractive.com>2011-03-18 16:36:52 +0300
commitb4743ccd8fdb577670d16ffdd6b3ad2132fa3fea (patch)
treecfbc3180eac504fe1d56d9f0ec33ee2cde863d13 /intern
parent879be45bb57c23e129f4b917b72d50fe05006400 (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')
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp2
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)
{