]> git.sesse.net Git - vlc/commitdiff
Fixed heavy memory leaks in bandlimited.c
authorLaurent Aimar <fenrir@videolan.org>
Tue, 26 Jan 2010 18:30:59 +0000 (19:30 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Tue, 26 Jan 2010 20:10:00 +0000 (21:10 +0100)
modules/audio_filter/resampler/bandlimited.c

index 18fb3ed1649be2b80e2ee614c46cd77ce91456ca..88512f010a4f6cd91c056cf5ec54c756427ba0d5 100644 (file)
@@ -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;
 }