fixed: AudioGeneratorMP3 read uninitialized memory on first iteration

This commit is contained in:
Roman Lut 2022-05-08 01:39:14 +03:00
parent 76235d0e3f
commit e0e0b5c4e6
1 changed files with 2 additions and 2 deletions

View File

@ -199,8 +199,8 @@ bool AudioGeneratorMP3::GetOneSample(int16_t sample[2])
break; // Do nothing
}
// for IGNORE and CONTINUE, just play what we have now
sample[AudioOutput::LEFTCHANNEL ] = synth->pcm.samples[0][samplePtr];
sample[AudioOutput::RIGHTCHANNEL] = synth->pcm.samples[1][samplePtr];
sample[AudioOutput::LEFTCHANNEL ] = lastSample[0];
sample[AudioOutput::RIGHTCHANNEL] = lastSample[1];
samplePtr++;
}
return true;