audio: Fixed dst pointer on channel conversions that grow in-place.

This commit is contained in:
Ryan C. Gordon
2022-07-20 17:22:41 -04:00
parent 9f56c7cf02
commit bec721f08a
2 changed files with 29 additions and 29 deletions

View File

@@ -266,7 +266,7 @@ static void write_converter(const int fromchans, const int tochans)
"{\n", remove_dots(fromstr), remove_dots(tostr));
if (convert_backwards) { /* must convert backwards when growing the output in-place. */
printf(" float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / %d) * %d)));\n", fromchans, tochans - 1);
printf(" float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / %d) * %d))) - %d;\n", fromchans, tochans, tochans);
printf(" const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - %d;\n", fromchans);
} else {
printf(" float *dst = (float *) cvt->buf;\n");