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:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user