Initialize a few sas values earlier.

This just makes things a little safer, none of these ought to be used
without Start or similar.
This commit is contained in:
Unknown W. Brackets 2015-03-28 13:06:57 -07:00
parent 0aaabcaac9
commit 03bd1b9b69

View File

@ -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),