Commit 301cde4d authored by Jon Lech Johansen's avatar Jon Lech Johansen

Fixed a memory leak in the ifo parser and input_EndStream

parent 3007c6b8
......@@ -2,7 +2,7 @@
* dvd_ifo.c: Functions for ifo parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_ifo.c,v 1.36 2001/08/06 13:28:00 sam Exp $
* $Id: dvd_ifo.c,v 1.37 2001/08/09 20:16:17 jlj Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* German Tischler <tanis@gaspode.franken.de>
......@@ -1145,21 +1145,21 @@ static int FreeTitle( title_t * p_title )
{
free( p_title->command.p_cell_command );
}
}
if( p_title->i_chapter_map_start_byte )
{
free( p_title->chapter_map.pi_start_cell );
}
if( p_title->i_chapter_map_start_byte )
{
free( p_title->chapter_map.pi_start_cell );
}
if( p_title->i_cell_play_start_byte )
{
free( p_title->p_cell_play );
}
if( p_title->i_cell_play_start_byte )
{
free( p_title->p_cell_play );
}
if( p_title->i_cell_pos_start_byte )
{
free( p_title->p_cell_pos );
}
if( p_title->i_cell_pos_start_byte )
{
free( p_title->p_cell_pos );
}
return 0;
......@@ -1221,8 +1221,15 @@ static int ReadUnitInf( ifo_t * p_ifo, unit_inf_t * p_unit_inf,
*****************************************************************************/
static int FreeUnitInf( unit_inf_t * p_unit_inf )
{
int i;
if( p_unit_inf->p_title != NULL )
{
for( i = 0 ; i < p_unit_inf->i_title_nb ; i++ )
{
FreeTitle( &p_unit_inf->p_title[i].title );
}
free( p_unit_inf->p_title );
}
......
......@@ -7,7 +7,7 @@
* will only be given back to netlist when refcount is zero.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000, 2001 VideoLAN
* $Id: dvd_netlist.c,v 1.13 2001/07/30 00:53:05 sam Exp $
* $Id: dvd_netlist.c,v 1.14 2001/08/09 20:16:17 jlj Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
* Stphane Borel <stef@videolan.org>
......@@ -585,9 +585,10 @@ void DVDNetlistEnd( dvd_netlist_t * p_netlist )
vlc_mutex_destroy( &p_netlist->lock );
/* free the FIFO, the buffer, and the netlist structure */
free( p_netlist->pp_free_data );
free( p_netlist->pp_free_pes );
free( p_netlist->pi_refcount );
free( p_netlist->p_free_iovec );
free( p_netlist->pp_free_pes );
free( p_netlist->pp_free_data );
free( p_netlist->p_pes );
free( p_netlist->p_data );
free( p_netlist->p_buffers );
......
......@@ -10,7 +10,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.84 2001/08/06 13:28:00 sam Exp $
* $Id: input_dvd.c,v 1.85 2001/08/09 20:16:17 jlj Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -514,6 +514,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
input_UnselectES( p_input, p_input->stream.pp_selected_es[i] );
}
free( p_input->stream.pp_selected_es );
input_DelProgram( p_input, p_input->stream.pp_programs[0] );
p_input->stream.pp_selected_es = NULL;
......
......@@ -2,7 +2,7 @@
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_programs.c,v 1.60 2001/07/17 09:48:08 massiot Exp $
* $Id: input_programs.c,v 1.61 2001/08/09 20:16:17 jlj Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -104,6 +104,12 @@ void input_EndStream( input_thread_t * p_input )
input_DelArea( p_input, p_input->stream.pp_areas[0] );
}
/* Free selected ES */
if( p_input->stream.pp_selected_es != NULL )
{
free( p_input->stream.pp_selected_es );
}
if( p_input->stream.p_demux_data != NULL )
{
free( p_input->stream.p_demux_data );
......
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