[vlc-devel] commit: Fixed heavy memory leaks in bandlimited.c (Laurent Aimar )

git version control git at videolan.org
Tue Jan 26 21:10:14 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Jan 26 19:30:59 2010 +0100| [3f7117af00a9d95ceabba1d98465118c7f026eac] | committer: Laurent Aimar 

Fixed heavy memory leaks in bandlimited.c

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3f7117af00a9d95ceabba1d98465118c7f026eac
---

 modules/audio_filter/resampler/bandlimited.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/modules/audio_filter/resampler/bandlimited.c b/modules/audio_filter/resampler/bandlimited.c
index 18fb3ed..88512f0 100644
--- a/modules/audio_filter/resampler/bandlimited.c
+++ b/modules/audio_filter/resampler/bandlimited.c
@@ -147,7 +147,10 @@ static block_t *Resample( filter_t * p_filter, block_t * p_in_buf )
             + p_filter->p_sys->i_buf_size;
     block_t *p_out_buf = filter_NewAudioBuffer( p_filter, i_out_size );
     if( !p_out_buf )
+    {
+        block_Release( p_in_buf );
         return NULL;
+    }
     float *p_out = (float *)p_out_buf->p_buffer;
 
     if( (p_in_buf->i_flags & BLOCK_FLAG_DISCONTINUITY) || p_sys->b_first )
@@ -370,6 +373,7 @@ static block_t *Resample( filter_t * p_filter, block_t * p_in_buf )
             else
             {
                 p_sys->i_buf_size = p_sys->i_old_wing = 0; /* oops! */
+                block_Release( p_in_buf );
                 return p_out_buf;
             }
         }
@@ -384,6 +388,7 @@ static block_t *Resample( filter_t * p_filter, block_t * p_in_buf )
              i_out * p_filter->fmt_in.audio.i_bytes_per_frame );
 #endif
 
+    block_Release( p_in_buf );
     return p_out_buf;
 }
 




More information about the vlc-devel mailing list