diff options
| author | JMC47 <JMC4789@gmail.com> | 2022-10-24 01:43:22 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-24 01:43:22 -0400 |
| commit | 4787b25a7f2acfb36a1e49a663c433640e6e3527 (patch) | |
| tree | 42391d8dd728409b0c4fcf4e8f0a568b212497b8 /Source/Core/AudioCommon/WaveFile.cpp | |
| parent | 4ab47231bc6919c81067e150476e6b09de0632f3 (diff) | |
| parent | 6de55e416b337dd7eee3df85d967a31a12169186 (diff) | |
Merge pull request #10741 from Pokechu22/audio-dma-one-block-at-a-time
DSP: Copy audio dma samples one block at a time
Diffstat (limited to 'Source/Core/AudioCommon/WaveFile.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/WaveFile.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/Core/AudioCommon/WaveFile.cpp b/Source/Core/AudioCommon/WaveFile.cpp index dc689e74dd..2e67d86519 100644 --- a/Source/Core/AudioCommon/WaveFile.cpp +++ b/Source/Core/AudioCommon/WaveFile.cpp @@ -119,10 +119,16 @@ void WaveFileWriter::AddStereoSamplesBE(const short* sample_data, u32 count, u32 sample_rate_divisor, int l_volume, int r_volume) { if (!file) + { ERROR_LOG_FMT(AUDIO, "WaveFileWriter - file not open."); + return; + } - if (count > BUFFER_SIZE * 2) + if (count * 2 > BUFFER_SIZE) + { ERROR_LOG_FMT(AUDIO, "WaveFileWriter - buffer too small (count = {}).", count); + return; + } if (skip_silence) { |
