# HG changeset patch # User anders # Date 1033556437 0 # Node ID 31d0ea35c66b7a95229e1d30d36451da68aefc9b # Parent 255039c14525fc863e81c819176a949adf672c6c Fixing potential future problem with buffer overrun diff -r 255039c14525 -r 31d0ea35c66b libaf/af.c --- a/libaf/af.c Wed Oct 02 10:47:18 2002 +0000 +++ b/libaf/af.c Wed Oct 02 11:00:37 2002 +0000 @@ -408,7 +408,8 @@ 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)