Fixes Issue 2596 @old wiimote plugin. Core data hasnt been zero'd everywhere before usage.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5440 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
snzgoo 2010-05-08 10:54:53 +00:00
parent 39b17ca640
commit 08b5ee6555
1 changed files with 4 additions and 2 deletions

View File

@ -165,8 +165,9 @@ void WmSendAck(u16 _channelID, u8 _reportID)
u8 DataFrame[1024]; u8 DataFrame[1024];
// Write DataFrame header // Write DataFrame header
u32 Offset = WriteWmReportHdr(DataFrame, WM_ACK_DATA); u32 Offset = WriteWmReportHdr(DataFrame, WM_ACK_DATA);
wm_acknowledge* pData = (wm_acknowledge*)(DataFrame + Offset); wm_acknowledge* pData = (wm_acknowledge*)(DataFrame + Offset);
memset(pData, 0, sizeof(wm_acknowledge));
#if defined(HAVE_WX) && HAVE_WX #if defined(HAVE_WX) && HAVE_WX
FillReportInfo(pData->buttons); FillReportInfo(pData->buttons);
#endif #endif
@ -309,7 +310,8 @@ void SendReadDataReply(u16 _channelID, void* _Base, u16 _Address, u8 _AddressHI,
int copySize = (_Size > 16) ? 16 : _Size; int copySize = (_Size > 16) ? 16 : _Size;
// AyuanX: the MTU is 640B though... what a waste! // AyuanX: the MTU is 640B though... what a waste!
wm_read_data_reply* pReply = (wm_read_data_reply*)(DataFrame + Offset); wm_read_data_reply* pReply = (wm_read_data_reply*)(DataFrame + Offset);
memset(pReply,0,sizeof(wm_read_data_reply));
Offset += sizeof(wm_read_data_reply); Offset += sizeof(wm_read_data_reply);
#if defined(HAVE_WX) && HAVE_WX #if defined(HAVE_WX) && HAVE_WX