diff options
author | anders <anders@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-10-03 12:43:39 +0000 |
---|---|---|
committer | anders <anders@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-10-03 12:43:39 +0000 |
commit | 94f26b18df137fdc3b7faee6637cd52dd90575c0 (patch) | |
tree | d78914623f2db36ae47a34500c693d1fb40e0b5b /libaf | |
parent | 7ca1ef4974a05ddf98eda4c39b88f652738ed13e (diff) |
Fixing the fix buffer overrun should work now
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7591 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libaf')
-rw-r--r-- | libaf/af.c | 2 | ||||
-rw-r--r-- | libaf/af_channels.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libaf/af.c b/libaf/af.c index 35e2a925a5..9313dffd27 100644 --- a/libaf/af.c +++ b/libaf/af.c @@ -370,7 +370,7 @@ af_data_t* af_play(af_stream_t* s, af_data_t* data) 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 --git a/libaf/af_channels.c b/libaf/af_channels.c index 042023f49f..fe2a05f231 100644 --- a/libaf/af_channels.c +++ b/libaf/af_channels.c @@ -122,7 +122,7 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data) // 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 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data) // 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; |