[vlc-devel] commit: vobsub: strdup memleak (stream_Add copies the format) ( Derk-Jan Hartman )
git version control
git at videolan.org
Mon Jun 1 12:37:17 CEST 2009
vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Mon Jun 1 11:58:30 2009 +0200| [f8bc94143ea531b39ef2eaf651154af316e1e2e4] | committer: Derk-Jan Hartman
vobsub: strdup memleak (stream_Add copies the format)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f8bc94143ea531b39ef2eaf651154af316e1e2e4
---
modules/demux/vobsub.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/modules/demux/vobsub.c b/modules/demux/vobsub.c
index e6f6c7e..6b9088d 100644
--- a/modules/demux/vobsub.c
+++ b/modules/demux/vobsub.c
@@ -513,7 +513,7 @@ static int ParseVobSubIDX( demux_t *p_demux )
}
else if( !strncmp( "id:", line, 3 ) )
{
- char language[20];
+ char language[3];
int i_track_id;
es_format_t fmt;
@@ -523,6 +523,7 @@ static int ParseVobSubIDX( demux_t *p_demux )
{
p_sys->i_tracks++;
p_sys->track = realloc( p_sys->track, sizeof( vobsub_track_t ) * (p_sys->i_tracks + 1 ) );
+ language[2] = '\0';
/* Init the track */
current_tk = &p_sys->track[p_sys->i_tracks - 1];
@@ -536,7 +537,7 @@ static int ParseVobSubIDX( demux_t *p_demux )
es_format_Init( &fmt, SPU_ES, VLC_CODEC_SPU );
fmt.subs.spu.i_original_frame_width = p_sys->i_original_frame_width;
fmt.subs.spu.i_original_frame_height = p_sys->i_original_frame_height;
- fmt.psz_language = strdup( language );
+ fmt.psz_language = language;
if( p_sys->b_palette )
{
fmt.subs.spu.palette[0] = 0xBeef;
More information about the vlc-devel
mailing list