From 08b5ee65555b5096e964453e80574debb7bc65fb Mon Sep 17 00:00:00 2001 From: snzgoo Date: Sat, 8 May 2010 10:54:53 +0000 Subject: [PATCH] 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 --- Source/Plugins/Plugin_Wiimote/Src/EmuSubroutines.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Plugins/Plugin_Wiimote/Src/EmuSubroutines.cpp b/Source/Plugins/Plugin_Wiimote/Src/EmuSubroutines.cpp index a9f7034963..f25f13bd41 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/EmuSubroutines.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/EmuSubroutines.cpp @@ -165,8 +165,9 @@ void WmSendAck(u16 _channelID, u8 _reportID) u8 DataFrame[1024]; // Write DataFrame header u32 Offset = WriteWmReportHdr(DataFrame, WM_ACK_DATA); - wm_acknowledge* pData = (wm_acknowledge*)(DataFrame + Offset); + memset(pData, 0, sizeof(wm_acknowledge)); + #if defined(HAVE_WX) && HAVE_WX FillReportInfo(pData->buttons); #endif @@ -309,7 +310,8 @@ void SendReadDataReply(u16 _channelID, void* _Base, u16 _Address, u8 _AddressHI, int copySize = (_Size > 16) ? 16 : _Size; // 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); #if defined(HAVE_WX) && HAVE_WX