Commit 94e3a9b9 authored by Gildas Bazin's avatar Gildas Bazin

* Fixed another bunch of memory leaks.

parent dbe51edf
...@@ -245,7 +245,9 @@ static inline void es_format_Copy( es_format_t *dst, es_format_t *src ) ...@@ -245,7 +245,9 @@ static inline void es_format_Copy( es_format_t *dst, es_format_t *src )
} }
dst->i_extra_languages = src->i_extra_languages; dst->i_extra_languages = src->i_extra_languages;
dst->p_extra_languages = (extra_languages_t*) malloc( dst->i_extra_languages * sizeof(*dst->p_extra_languages ) ); if( dst->i_extra_languages )
dst->p_extra_languages = (extra_languages_t*)
malloc(dst->i_extra_languages * sizeof(*dst->p_extra_languages ));
for( i = 0; i < dst->i_extra_languages; i++ ) { for( i = 0; i < dst->i_extra_languages; i++ ) {
if( src->p_extra_languages[i].psz_language ) if( src->p_extra_languages[i].psz_language )
dst->p_extra_languages[i].psz_language = strdup(src->p_extra_languages[i].psz_language); dst->p_extra_languages[i].psz_language = strdup(src->p_extra_languages[i].psz_language);
......
...@@ -404,6 +404,7 @@ static void Close( vlc_object_t *p_this ) ...@@ -404,6 +404,7 @@ static void Close( vlc_object_t *p_this )
decoder_sys_t *p_sys = p_dec->p_sys; decoder_sys_t *p_sys = p_dec->p_sys;
faacDecClose( p_sys->hfaad ); faacDecClose( p_sys->hfaad );
if( p_sys->p_buffer ) free( p_sys->p_buffer );
free( p_sys ); free( p_sys );
} }
......
...@@ -426,12 +426,15 @@ static int AVI_ChunkRead_strd( stream_t *s, avi_chunk_t *p_chk ) ...@@ -426,12 +426,15 @@ static int AVI_ChunkRead_strd( stream_t *s, avi_chunk_t *p_chk )
{ {
AVI_READCHUNK_ENTER; AVI_READCHUNK_ENTER;
p_chk->strd.p_data = malloc( p_chk->common.i_chunk_size ); p_chk->strd.p_data = malloc( p_chk->common.i_chunk_size );
memcpy( p_chk->strd.p_data, memcpy( p_chk->strd.p_data, p_buff + 8, p_chk->common.i_chunk_size );
p_buff + 8,
p_chk->common.i_chunk_size );
AVI_READCHUNK_EXIT( VLC_SUCCESS ); AVI_READCHUNK_EXIT( VLC_SUCCESS );
} }
static void AVI_ChunkFree_strd( avi_chunk_t *p_chk )
{
if( p_chk->strd.p_data ) free( p_chk->strd.p_data );
}
static int AVI_ChunkRead_idx1( stream_t *s, avi_chunk_t *p_chk ) static int AVI_ChunkRead_idx1( stream_t *s, avi_chunk_t *p_chk )
{ {
unsigned int i_count, i_index; unsigned int i_count, i_index;
...@@ -651,7 +654,7 @@ static struct ...@@ -651,7 +654,7 @@ static struct
{ AVIFOURCC_avih, AVI_ChunkRead_avih, AVI_ChunkFree_nothing }, { AVIFOURCC_avih, AVI_ChunkRead_avih, AVI_ChunkFree_nothing },
{ AVIFOURCC_strh, AVI_ChunkRead_strh, AVI_ChunkFree_nothing }, { AVIFOURCC_strh, AVI_ChunkRead_strh, AVI_ChunkFree_nothing },
{ AVIFOURCC_strf, AVI_ChunkRead_strf, AVI_ChunkFree_strf }, { AVIFOURCC_strf, AVI_ChunkRead_strf, AVI_ChunkFree_strf },
{ AVIFOURCC_strd, AVI_ChunkRead_strd, AVI_ChunkFree_nothing }, { AVIFOURCC_strd, AVI_ChunkRead_strd, AVI_ChunkFree_strd },
{ AVIFOURCC_idx1, AVI_ChunkRead_idx1, AVI_ChunkFree_idx1 }, { AVIFOURCC_idx1, AVI_ChunkRead_idx1, AVI_ChunkFree_idx1 },
{ AVIFOURCC_indx, AVI_ChunkRead_indx, AVI_ChunkFree_indx }, { AVIFOURCC_indx, AVI_ChunkRead_indx, AVI_ChunkFree_indx },
{ AVIFOURCC_JUNK, AVI_ChunkRead_nothing, AVI_ChunkFree_nothing }, { AVIFOURCC_JUNK, AVI_ChunkRead_nothing, AVI_ChunkFree_nothing },
......
...@@ -285,7 +285,9 @@ static int Demux( demux_t *p_demux ) ...@@ -285,7 +285,9 @@ static int Demux( demux_t *p_demux )
{ {
p_sys->b_start = VLC_FALSE; p_sys->b_start = VLC_FALSE;
p_block_in = p_sys->p_block_in; p_block_in = p_sys->p_block_in;
p_sys->p_block_in = NULL;
p_block_out = p_sys->p_block_out; p_block_out = p_sys->p_block_out;
p_sys->p_block_out = NULL;
} }
else else
{ {
...@@ -337,6 +339,8 @@ static void Close( vlc_object_t * p_this ) ...@@ -337,6 +339,8 @@ static void Close( vlc_object_t * p_this )
DESTROY_PACKETIZER( p_sys->p_packetizer ); DESTROY_PACKETIZER( p_sys->p_packetizer );
if( p_sys->meta ) vlc_meta_Delete( p_sys->meta ); if( p_sys->meta ) vlc_meta_Delete( p_sys->meta );
if( p_sys->p_block_in ) block_Release( p_sys->p_block_in );
if( p_sys->p_block_out ) block_Release( p_sys->p_block_out );
free( p_sys ); free( p_sys );
} }
......
...@@ -1094,6 +1094,7 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win ) ...@@ -1094,6 +1094,7 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
XStoreName( p_vout->p_sys->p_display, XStoreName( p_vout->p_sys->p_display,
p_win->base_window, val.psz_string ); p_win->base_window, val.psz_string );
} }
if( val.psz_string ) free( val.psz_string );
} }
} }
} }
...@@ -2116,6 +2117,8 @@ static int InitDisplay( vout_thread_t *p_vout ) ...@@ -2116,6 +2117,8 @@ static int InitDisplay( vout_thread_t *p_vout )
} }
} }
} }
if( p_formats ) XFree( p_formats );
break; break;
} }
p_vout->p_sys->p_visual = p_xvisual->visual; p_vout->p_sys->p_visual = p_xvisual->visual;
......
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