Commit 3487ec11 authored by Jean-Baptiste Kempf's avatar 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: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 86d57e54
......@@ -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;
......
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