Commit af043e92 authored by Gildas Bazin's avatar Gildas Bazin

* Fixed another bunch of memory leaks.

parent ee16b381
......@@ -99,7 +99,7 @@ vlc_module_begin();
add_submodule();
set_description( _("DTS audio packetizer") );
set_capability( "packetizer", 10 );
set_callbacks( OpenPacketizer, NULL );
set_callbacks( OpenPacketizer, CloseDecoder );
vlc_module_end();
/*****************************************************************************
......
......@@ -255,7 +255,9 @@ void E_(CloseDemux)( vlc_object_t *p_this )
{
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys = p_demux->p_sys;
unsigned int i;
FREENULL( p_sys->tk );
if( p_sys->ic ) av_close_input_file( p_sys->ic );
if( p_sys->io_buffer ) free( p_sys->io_buffer );
free( p_sys );
......
......@@ -215,8 +215,8 @@ static vlc_bool_t CheckMimeHeader( demux_t *p_demux, int *p_header_size )
msg_Warn( p_demux, "separator %s does not match %s", psz_line,
p_sys->psz_separator );
}
free( psz_line );
}
free( psz_line );
psz_line = GetLine( p_demux, &i_pos );
while( psz_line && *psz_line )
{
......
......@@ -176,11 +176,16 @@ static void Close( vlc_object_t *p_this )
if( tk->p_subpackets[ j ] )
block_Release( tk->p_subpackets[ j ] );
}
if( !tk->i_subpackets ) free( tk->p_subpackets );
if( tk->i_subpackets ) free( tk->p_subpackets );
free( tk );
}
if( p_sys->psz_title ) free( p_sys->psz_title );
if( p_sys->psz_artist ) free( p_sys->psz_artist );
if( p_sys->psz_copyright ) free( p_sys->psz_copyright );
if( p_sys->psz_description ) free( p_sys->psz_description );
if( p_sys->i_track > 0 ) free( p_sys->track );
free( p_sys );
}
......@@ -523,6 +528,8 @@ static int Demux( demux_t *p_demux )
p_block->i_dts = p_block->i_pts = i_pts;
tk->p_subpackets[i_index] = p_block;
tk->i_subpacket++;
msg_Err( p_demux, "PTS!DTS: %lld, %lld",
p_block->i_dts, p_block->i_pts);
}
if( tk->fmt.i_codec == VLC_FOURCC('2','8','_','8') )
......@@ -715,7 +722,7 @@ static int HeaderRead( demux_t *p_demux )
msg_Dbg( p_demux, "object %4.4s size=%d version=%d",
(char*)&i_id, i_size, i_version );
if( i_size < 10 )
if( i_size < 10 && i_id != VLC_FOURCC('D','A','T','A') )
{
msg_Dbg( p_demux, "invalid size for object %4.4s", (char*)&i_id );
return VLC_EGENERIC;
......
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