[Mplayer-cvslog] CVS: main/libaf af.c,1.2,1.3

Anders Johansson anders at mplayerhq.hu
Wed Oct 2 13:00:43 CEST 2002


Update of /cvsroot/mplayer/main/libaf
In directory mail:/var/tmp.root/cvs-serv18058

Modified Files:
	af.c 
Log Message:
Fixing potential future problem with buffer overrun

Index: af.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- af.c	1 Oct 2002 12:53:30 -0000	1.2
+++ af.c	2 Oct 2002 11:00:37 -0000	1.3
@@ -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) 




More information about the MPlayer-cvslog mailing list