sid: Fix an out-of-bounds read in the channel mixing code

Change-Id: Ie25b8ab90193e6bb580cd7c04f8c0ce281f7a301
This commit is contained in:
Solomon Peachy 2020-03-28 06:38:16 -04:00
parent f8cd15e226
commit 022dfe7ab3

View file

@ -554,7 +554,6 @@ void synth_render (int32_t *buffer_r, int32_t *buffer_l, unsigned long len)
* This filter sounds a lot like the 8580, as the low-quality, dirty * This filter sounds a lot like the 8580, as the low-quality, dirty
* sound of the 6581 is uuh too hard to achieve :) */ * sound of the 6581 is uuh too hard to achieve :) */
outf[0]+=outf[2]; /* mix voice 1 and 3 to right channel */
for (v=0;v<2;v++) { /* do step 3 for both channels */ for (v=0;v<2;v++) { /* do step 3 for both channels */
filter.h = quickfloat_ConvertFromInt(outf[v]) - (filter.b>>8)*filter.rez - filter.l; filter.h = quickfloat_ConvertFromInt(outf[v]) - (filter.b>>8)*filter.rez - filter.l;
filter.b += quickfloat_Multiply(filter.freq, filter.h); filter.b += quickfloat_Multiply(filter.freq, filter.h);