Fix a bug just introduced into the basic stuffing function.

This commit is contained in:
Mike Brady
2016-07-16 14:24:34 +01:00
parent adc44b2518
commit d12c7ec090
+5 -1
View File
@@ -890,7 +890,11 @@ static int stuff_buffer_basic(short *inptr, int length, short *outptr, int stuff
}
// if you're removing, i.e. stuff < 0, copy that much less over. If you're adding, do all the rest.
for (i = stuffsamp; i < (stuff>0) ? length : length+stuff; i++) {
int remainder = length;
if (stuff<0)
remainder = remainder+stuff; // don't run over the correct end of the output buffer
for (i = stuffsamp; i < remainder; i++) {
*outptr++ = dithered_vol(*inptr++);
*outptr++ = dithered_vol(*inptr++);
}