Commit 16ccd0f5 authored by Gildas Bazin's avatar Gildas Bazin

* modules/demux/mpeg/mpga.c, src/input/stream.c: fixed mem leaks.
parent 03e07903
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mpga.c : MPEG-I/II Audio input module for vlc * mpga.c : MPEG-I/II Audio input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: mpga.c,v 1.14 2003/12/27 16:14:48 asmax Exp $ * $Id: mpga.c,v 1.15 2004/01/03 00:23:04 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -329,12 +329,14 @@ static int Open( vlc_object_t * p_this ) ...@@ -329,12 +329,14 @@ static int Open( vlc_object_t * p_this )
{ {
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
msg_Err( p_input, "cannot init stream" ); msg_Err( p_input, "cannot init stream" );
if( fmt.psz_description ) free( fmt.psz_description );
goto error; goto error;
} }
p_input->stream.i_mux_rate = p_sys->i_bitrate_avg / 8 / 50; p_input->stream.i_mux_rate = p_sys->i_bitrate_avg / 8 / 50;
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
p_sys->p_es = es_out_Add( p_input->p_es_out, &fmt ); p_sys->p_es = es_out_Add( p_input->p_es_out, &fmt );
if( fmt.psz_description ) free( fmt.psz_description );
return VLC_SUCCESS; return VLC_SUCCESS;
error: error:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* stream.c * stream.c
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: stream.c,v 1.7 2003/11/21 00:38:01 gbazin Exp $ * $Id: stream.c,v 1.8 2004/01/03 00:23:04 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -230,8 +230,12 @@ int stream_Read( stream_t *s, void *p_data, int i_data ) ...@@ -230,8 +230,12 @@ int stream_Read( stream_t *s, void *p_data, int i_data )
i_count = input_SplitBuffer( s->p_input, &p_packet, i_count = input_SplitBuffer( s->p_input, &p_packet,
__MIN( i_data, (int)s->p_input->i_bufsize ) ); __MIN( i_data, (int)s->p_input->i_bufsize ) );
if( i_count <= 0 ) if( i_count <= 0 )
{ {
if( i_count == 0 )
input_DeletePacket( s->p_input->p_method_data, p_packet );
return i_read; return i_read;
} }
......
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