From 3c5326fd38cefe39bf0a1b836e0bf1baa9ad5e4d Mon Sep 17 00:00:00 2001 From: lioncash Date: Wed, 6 Aug 2014 12:10:05 -0400 Subject: [PATCH] Core: Default initialize a pointer to nullptr in gdsp_do_dma() The if-statement implies that this could fail in the switch statement somehow. If it does fail, then we'd be comparing with an uninitialized pointer. --- Source/Core/Core/DSP/DSPHWInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/DSP/DSPHWInterface.cpp b/Source/Core/Core/DSP/DSPHWInterface.cpp index 163c776a61..fc133484b8 100644 --- a/Source/Core/Core/DSP/DSPHWInterface.cpp +++ b/Source/Core/Core/DSP/DSPHWInterface.cpp @@ -341,7 +341,7 @@ static void gdsp_do_dma() DEBUG_LOG(DSPLLE, "DMA pc: %04x, Control: %04x, Address: %08x, DSP Address: %04x, Size: %04x", g_dsp.pc, ctl, addr, dsp_addr, len); #endif - const u8* copied_data_ptr; + const u8* copied_data_ptr = nullptr; switch (ctl & 0x3) { case (DSP_CR_DMEM | DSP_CR_TO_CPU):