Fix infinite loop in DownSampleWav when s_khz is less than 44 kHz

This fixes #330 where `s_khz` below 44 (the usual sample rate of mohaa wav files) would cause an infinite loop due to improper usage of the `ii` variable in the loop where another variable would be accidentally incremented instead
This commit is contained in:
smallmodel 2024-07-30 20:59:27 +02:00
parent 1d4fe357c8
commit f8b97405ff
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -396,7 +396,7 @@ qboolean DownSampleWav(wavinfo_t *info, byte *wav, int wavlength, int newkhz, by
error += newkhz;
while (error > oldrate) {
error -= oldrate;
for (ii = 0; ii < width; i++) {
for (ii = 0; ii < width; ii++) {
data_p[ii] = datap[ii];
}