fix: don't multiply the buffer length, as it's already the length of the audio buffer in bytes

This commit is contained in:
2025-03-25 11:10:36 +01:00
parent 52fefcef2b
commit 6cfd553f33

View File

@@ -73,7 +73,7 @@ static int8_t audio_cvt(audiodevice const* dev, SDL_AudioSpec const* spec, uint8
} else if (!cvt.needed) { // ensure the conversion is necessary
return 0;
}
cvt.len = (*len) * spec->channels; // calculate the size of the source data in bytes by multiplying the length by the amount of channels (warn: uint32_t -> int32_t)
cvt.len = (*len); // specify the length of the source data buffer in bytes (warn: uint32_t -> int32_t)
cvt.buf = realloc(*bufptr, cvt.len * cvt.len_mult); // grow the inputted buffer for the conversion
// ensure the conversion buffer reallocation goes correctly