diff options
author | anders <anders@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-10-02 11:00:37 +0000 |
---|---|---|
committer | anders <anders@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-10-02 11:00:37 +0000 |
commit | 5ad47aba1171743268926b902cce1186c6a2fd50 (patch) | |
tree | c4daa40855fd4cf5e0766df5c7af432e9b7bf450 /libaf/af.c | |
parent | 5c7b9ef0d4a95ec25386bdcfb957df5ebd78fc03 (diff) | |
download | mpv-5ad47aba1171743268926b902cce1186c6a2fd50.tar.bz2 mpv-5ad47aba1171743268926b902cce1186c6a2fd50.tar.xz |
Fixing potential future problem with buffer overrun
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7582 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libaf/af.c')
-rw-r--r-- | libaf/af.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) |