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.
This commit is contained in:
Nathan Letwory 2011-03-18 13:36:52 +00:00
parent 879be45bb5
commit b4743ccd8f

@ -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)
{