From 0ffc9099695192064f4f8217498f8285635cbb0e Mon Sep 17 00:00:00 2001 From: hrydgard Date: Mon, 22 Sep 2008 22:49:09 +0000 Subject: [PATCH] Fix random memory overwrite bug in DSP plugin. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@616 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_ROM.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_ROM.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_ROM.cpp index 71b54c8c02..435852fd1a 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_ROM.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_ROM.cpp @@ -21,7 +21,6 @@ #include "UCodes.h" #include "UCode_ROM.h" - CUCode_Rom::CUCode_Rom(CMailHandler& _rMailHandler) : IUCode(_rMailHandler) , m_BootTask_numSteps(0) @@ -32,15 +31,12 @@ CUCode_Rom::CUCode_Rom(CMailHandler& _rMailHandler) m_rMailHandler.PushMail(0x8071FEED); } - CUCode_Rom::~CUCode_Rom() {} - void CUCode_Rom::Update() {} - void CUCode_Rom::HandleMail(u32 _uMail) { if (m_NextParameter == 0) @@ -80,17 +76,17 @@ void CUCode_Rom::HandleMail(u32 _uMail) { m_CurrentUCode.m_StartPC = _uMail; BootUCode(); + return; // FIXES THE OVERWRITE } - break; + break; } + // THE GODDAMN OVERWRITE WAS HERE. Without the return above, since BootUCode may delete "this", well ... m_NextParameter = 0; } } - -void -CUCode_Rom::BootUCode() +void CUCode_Rom::BootUCode() { // simple non-scientific crc invented by ector :P // too annoying to change now, and probably good enough anyway