[vlc-commits] Vobsub: language is not necessarily on 2 characters
Jean-Baptiste Kempf
git at videolan.org
Wed Feb 23 20:55:29 CET 2011
vlc/vlc-1.1 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Feb 23 20:26:10 2011 +0100| [3487ec112fc8a4d338daeb16c4c7ff063cb34d61] | committer: Jean-Baptiste Kempf
Vobsub: language is not necessarily on 2 characters
This fixes quite a few .idx samples that didn't work before.
(cherry picked from commit a76a1d046ad221c6ac7132a064e25e5393d6ef98)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=3487ec112fc8a4d338daeb16c4c7ff063cb34d61
---
modules/demux/vobsub.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/demux/vobsub.c b/modules/demux/vobsub.c
index 8877da4..fceebb8 100644
--- a/modules/demux/vobsub.c
+++ b/modules/demux/vobsub.c
@@ -518,25 +518,25 @@ static int ParseVobSubIDX( demux_t *p_demux )
}
else if( !strncmp( "id:", line, 3 ) )
{
- char language[3];
+ char language[33]; /* Usually 2 or 3 letters, sometimes more.
+ Spec (or lack of) doesn't define any limit */
int i_track_id;
es_format_t fmt;
/* Lets start a new track */
- if( sscanf( line, "id: %2s, index: %d",
+ if( sscanf( line, "id: %32[^ ,], index: %d",
language, &i_track_id ) == 2 )
{
p_sys->i_tracks++;
p_sys->track = xrealloc( 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];
memset( current_tk, 0, sizeof( vobsub_track_t ) );
current_tk->i_current_subtitle = 0;
current_tk->i_subtitles = 0;
- current_tk->p_subtitles = xmalloc( sizeof( subtitle_t ) );;
+ current_tk->p_subtitles = xmalloc( sizeof( subtitle_t ) );
current_tk->i_track_id = i_track_id;
current_tk->i_delay = (int64_t)0;
More information about the vlc-commits
mailing list