Commit f6fd063a authored by Gildas Bazin's avatar Gildas Bazin

* modules/demux/ogg.c: fixed memleak.
* modules/codec/flac.c: fixed memleak.
* include/vlc_es.h: es_format_Free().
parent 4ca92c14
......@@ -2,7 +2,7 @@
* vlc_es.h: Elementary stream formats descriptions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: vlc_es.h,v 1.8 2004/01/30 15:17:39 fenrir Exp $
* $Id: vlc_es.h,v 1.9 2004/02/07 00:16:34 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -179,8 +179,10 @@ static inline void es_format_Init( es_format_t *fmt,
static inline void es_format_Copy( es_format_t *dst, es_format_t *src )
{
memcpy( dst, src, sizeof( es_format_t ) );
if( src->psz_language ) dst->psz_language = strdup( src->psz_language );
if( src->psz_description ) dst->psz_description = strdup( src->psz_description );
if( src->psz_language )
dst->psz_language = strdup( src->psz_language );
if( src->psz_description )
dst->psz_description = strdup( src->psz_description );
if( src->i_extra > 0 )
{
dst->p_extra = malloc( src->i_extra );
......@@ -194,4 +196,12 @@ static inline void es_format_Copy( es_format_t *dst, es_format_t *src )
}
}
static inline void es_format_Free( es_format_t *fmt )
{
if( fmt->psz_language ) free( fmt->psz_language );
if( fmt->psz_description ) free( fmt->psz_description );
if( fmt->i_extra > 0 ) free( fmt->p_extra );
if( fmt->video.p_palette ) free( fmt->video.p_palette );
}
#endif
......@@ -2,7 +2,7 @@
* flac.c: flac decoder/packetizer/encoder module making use of libflac
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: flac.c,v 1.7 2004/01/25 18:20:12 bigben Exp $
* $Id: flac.c,v 1.8 2004/02/07 00:16:34 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Sigmund Augdal <sigmunau@idi.ntnu.no>
......@@ -424,6 +424,7 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
}
block_Release( p_sys->p_block );
p_sys->p_block = NULL;
}
return p_sys->p_aout_buffer;
......@@ -439,6 +440,7 @@ static void CloseDecoder( vlc_object_t *p_this )
FLAC__stream_decoder_finish( p_sys->p_flac );
FLAC__stream_decoder_delete( p_sys->p_flac );
if( p_sys->p_block ) free( p_sys->p_block );
free( p_sys );
}
......
......@@ -2,7 +2,7 @@
* ogg.c : ogg stream demux module for vlc
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: ogg.c,v 1.54 2004/02/06 23:43:32 gbazin Exp $
* $Id: ogg.c,v 1.55 2004/02/07 00:16:34 gbazin Exp $
*
* Author: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -1111,6 +1111,8 @@ static void Ogg_EndOfStream( input_thread_t *p_input, demux_sys_t *p_ogg )
if( p_ogg->pp_stream[i_stream]->p_packets_backup)
free( p_ogg->pp_stream[i_stream]->p_packets_backup );
es_format_Free( &p_stream->fmt );
free( p_ogg->pp_stream[i_stream] );
}
#undef p_stream
......
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