From 03bd1b9b6935fd9986ccc21415d4a031801672b2 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 28 Mar 2015 13:06:57 -0700 Subject: [PATCH] Initialize a few sas values earlier. This just makes things a little safer, none of these ought to be used without Start or similar. --- Core/HW/SasAudio.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Core/HW/SasAudio.h b/Core/HW/SasAudio.h index 2f9aa9771c..9e2216b5b5 100644 --- a/Core/HW/SasAudio.h +++ b/Core/HW/SasAudio.h @@ -91,7 +91,9 @@ enum VoiceType { // It compresses 28 16-bit samples into a block of 16 bytes. class VagDecoder { public: - VagDecoder() : data_(0), read_(0), end_(true) {} + VagDecoder() : data_(0), read_(0), end_(true) { + memset(samples, 0, sizeof(samples)); + } void Start(u32 dataPtr, u32 vagSize, bool loopEnabled); void GetSamples(s16 *outSamples, int numSamples); @@ -202,6 +204,8 @@ struct SasVoice { vagSize(0), pcmAddr(0), pcmSize(0), + pcmIndex(0), + pcmLoopPos(0), sampleRate(44100), sampleFrac(0), pitch(PSP_SAS_PITCH_BASE),