changeset 22180:13815ffcada5

Fix memory leak when changing playback speed
author uau
date Sat, 10 Feb 2007 19:47:22 +0000
parents ecf562795caf
children e99ebf35812b
files libmpcodecs/dec_audio.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/dec_audio.c	Sat Feb 10 18:12:03 2007 +0000
+++ b/libmpcodecs/dec_audio.c	Sat Feb 10 19:47:22 2007 +0000
@@ -333,6 +333,8 @@
   if(out_maxsize<8192) out_maxsize=MAX_OUTBURST; // not sure this is ok
 
   sh_audio->a_out_buffer_size=out_maxsize;
+  if (sh_audio->a_out_buffer != sh_audio->a_buffer)
+      free(sh_audio->a_out_buffer);
   sh_audio->a_out_buffer=memalign(16,sh_audio->a_out_buffer_size);
   memset(sh_audio->a_out_buffer,0,sh_audio->a_out_buffer_size);
   sh_audio->a_out_buffer_len=0;