Commit 3f7117af authored by Laurent Aimar's avatar Laurent Aimar

Fixed heavy memory leaks in bandlimited.c

parent e080f331
...@@ -147,7 +147,10 @@ static block_t *Resample( filter_t * p_filter, block_t * p_in_buf ) ...@@ -147,7 +147,10 @@ static block_t *Resample( filter_t * p_filter, block_t * p_in_buf )
+ p_filter->p_sys->i_buf_size; + p_filter->p_sys->i_buf_size;
block_t *p_out_buf = filter_NewAudioBuffer( p_filter, i_out_size ); block_t *p_out_buf = filter_NewAudioBuffer( p_filter, i_out_size );
if( !p_out_buf ) if( !p_out_buf )
{
block_Release( p_in_buf );
return NULL; return NULL;
}
float *p_out = (float *)p_out_buf->p_buffer; float *p_out = (float *)p_out_buf->p_buffer;
if( (p_in_buf->i_flags & BLOCK_FLAG_DISCONTINUITY) || p_sys->b_first ) 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 ) ...@@ -370,6 +373,7 @@ static block_t *Resample( filter_t * p_filter, block_t * p_in_buf )
else else
{ {
p_sys->i_buf_size = p_sys->i_old_wing = 0; /* oops! */ p_sys->i_buf_size = p_sys->i_old_wing = 0; /* oops! */
block_Release( p_in_buf );
return p_out_buf; return p_out_buf;
} }
} }
...@@ -384,6 +388,7 @@ static block_t *Resample( filter_t * p_filter, block_t * p_in_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 ); i_out * p_filter->fmt_in.audio.i_bytes_per_frame );
#endif #endif
block_Release( p_in_buf );
return p_out_buf; return p_out_buf;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment