Commit 1ac32f37 authored by Sam Hocevar's avatar Sam Hocevar

* ./src/interface/main.c: fixed a little memleak.

  * ./src/input/input_dec.c: removed useless code.
  * ./src/input/input.c, ./plugins/gtk/gtk.c: fixed access to uninitialized
    variables.
  * ./plugins/dvd/dvd_demux.c: fixed the pf_demux return value.
parent e7061e86
/* dvd_demux.c: DVD demux functions.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: dvd_demux.c,v 1.5 2002/04/25 21:52:42 sam Exp $
* $Id: dvd_demux.c,v 1.6 2002/05/20 22:39:36 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -119,10 +119,16 @@ static int DVDDemux( input_thread_t * p_input )
/* Read headers to compute payload length */
for( i = 0 ; i < DVD_READ_ONCE ; i++ )
{
if( ( i_result = input_ReadPS( p_input, &p_data ) ) <= 0)
i_result = input_ReadPS( p_input, &p_data );
if( i_result < 0 )
{
return i_result;
}
else if( i_result == 0 )
{
return i;
}
input_DemuxPS( p_input, p_data );
}
......
......@@ -2,7 +2,7 @@
* gtk.c : Gtk+ plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: gtk.c,v 1.21 2002/05/04 02:05:03 lool Exp $
* $Id: gtk.c,v 1.22 2002/05/20 22:39:36 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -168,6 +168,8 @@ static int intf_Open( intf_thread_t *p_intf )
p_intf->p_sys->pf_callback[0] = NULL;
p_intf->p_sys->i_part = 0;
return( 0 );
}
......
......@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input.c,v 1.195 2002/05/14 21:23:44 massiot Exp $
* $Id: input.c,v 1.196 2002/05/20 22:39:36 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -165,6 +165,7 @@ input_thread_t *input_CreateThread ( playlist_item_t *p_item, int *pi_status )
p_input->stream.i_new_status = p_input->stream.i_new_rate = 0;
p_input->stream.b_new_mute = MUTE_NO_CHANGE;
p_input->stream.i_mux_rate = 0;
p_input->stream.b_seekable = 0;
/* no stream, no program, no area, no es */
p_input->stream.p_new_program = NULL;
......
......@@ -2,7 +2,7 @@
* input_dec.c: Functions for the management of decoders
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: input_dec.c,v 1.35 2002/05/15 15:46:34 asmax Exp $
* $Id: input_dec.c,v 1.36 2002/05/20 22:39:36 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -224,29 +224,18 @@ static decoder_config_t * CreateDecoderConfig( input_thread_t * p_input,
/* Select a new ES */
p_input->stream.i_selected_es_number++;
if( p_input->stream.i_selected_es_number > 0 )
{
p_input->stream.pp_selected_es = realloc(
p_input->stream.pp_selected_es = realloc(
p_input->stream.pp_selected_es,
p_input->stream.i_selected_es_number
* sizeof(es_descriptor_t *) );
if( p_input->stream.pp_selected_es == NULL )
{
intf_ErrMsg( "Unable to realloc memory" );
free( p_config->p_decoder_fifo );
free( p_config );
return NULL;
}
}
else
{
intf_ErrMsg( "realloc(0) (p_input->stream.i_selected_es_number "
"corrupted?)" );
if( p_input->stream.pp_selected_es == NULL )
{
intf_ErrMsg( "Unable to realloc memory" );
free( p_config->p_decoder_fifo );
free( p_config );
return NULL;
}
p_input->stream.pp_selected_es[p_input->stream.i_selected_es_number - 1]
= p_es;
......
......@@ -4,7 +4,7 @@
* and spawn threads.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: main.c,v 1.193 2002/05/19 12:57:32 gbazin Exp $
* $Id: main.c,v 1.194 2002/05/20 22:39:36 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -861,13 +861,15 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
intf_PlaylistDestroy( p_main->p_playlist );
/*
* Free memcpy module if it was allocated
* Free allocated memory
*/
if( p_main->p_memcpy_module != NULL )
{
module_Unneed( p_main->p_memcpy_module );
}
free( p_main->psz_homedir );
/*
* Free module bank
*/
......
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