From 5ad47aba1171743268926b902cce1186c6a2fd50 Mon Sep 17 00:00:00 2001 From: anders Date: Wed, 2 Oct 2002 11:00:37 +0000 Subject: Fixing potential future problem with buffer overrun git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7582 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libaf/af.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libaf') diff --git a/libaf/af.c b/libaf/af.c index 85569efba6..2466554588 100644 --- a/libaf/af.c +++ b/libaf/af.c @@ -408,7 +408,8 @@ int af_inputlen(af_stream_t* s, int len) inline int af_resize_local_buffer(af_instance_t* af, af_data_t* data) { // Calculate new length - register int len = af_lencalc(af->mul,data->len); + register int len = af_lencalc(af->mul,data->len/(data->nch*data->bps)) * + data->nch * data->bps; mp_msg(MSGT_AFILTER,MSGL_V,"Reallocating memory in module %s, old len = %i, new len = %i\n",af->info->name,af->data->len,len); // If there is a buffer free it if(af->data->audio) -- cgit v1.2.3