# HG changeset patch # User anders # Date 1033649019 0 # Node ID 0cba734693418dda868c9ea7ed8154fed7824ad6 # Parent 443b440798a53bb764dee2653edd6b75be904f48 Fixing the fix buffer overrun should work now diff -r 443b440798a5 -r 0cba73469341 libaf/af.c --- a/libaf/af.c Thu Oct 03 12:02:46 2002 +0000 +++ b/libaf/af.c Thu Oct 03 12:43:39 2002 +0000 @@ -370,7 +370,7 @@ needed */ inline int af_lencalc(frac_t mul, af_data_t* d){ register int t = d->bps*d->nch; - return t*(((d->len/t)*mul.n + 1)/mul.d); + return t*(((d->len/t)*mul.n)/mul.d + 1); } /* Calculate how long the output from the filters will be given the diff -r 443b440798a5 -r 0cba73469341 libaf/af_channels.c --- a/libaf/af_channels.c Thu Oct 03 12:02:46 2002 +0000 +++ b/libaf/af_channels.c Thu Oct 03 12:43:39 2002 +0000 @@ -122,7 +122,7 @@ // Reset unused channels if nch in < nch out if(af->mul.n > af->mul.d) - memset(l->audio,0,af_lencalc(af->mul, c)); + memset(l->audio,0,(c->len*af->mul.n)/af->mul.d); // Special case always output L & R if(c->nch == 1){ @@ -143,7 +143,7 @@ // Set output data c->audio = l->audio; - c->len = af_lencalc(af->mul, c); + c->len = (c->len*af->mul.n)/af->mul.d; c->nch = l->nch; return c;