mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 03:18:13 +00:00
Fix buffer overrun in ConvertAudio with different src/dst channel count
- Source or destination format also has to not be F32 to trigger bug
This commit is contained in:
@@ -325,7 +325,7 @@ void ConvertAudio(int num_frames,
|
||||
|
||||
// Gain adjustment
|
||||
if (gain != 1.0f) {
|
||||
float *buf = (float *)(dstconvert ? scratch : dst);
|
||||
float *buf = (float *)((channelconvert || dstconvert) ? scratch : dst);
|
||||
const int total_samples = num_frames * src_channels;
|
||||
if (src == buf) {
|
||||
for (int i = 0; i < total_samples; i++) {
|
||||
|
Reference in New Issue
Block a user