changeset 7581:31d0ea35c66b

Fixing potential future problem with buffer overrun
author anders
date Wed, 02 Oct 2002 11:00:37 +0000
parents 255039c14525
children 4a233f3b09a7
files libaf/af.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)