Commit 64220f44 authored by gbazin's avatar gbazin
Browse files

* modules/demux/playlist/gvp.c: fixed segfault in detection code.

parent 9361dd4a
......@@ -77,14 +77,23 @@ static int Control( demux_t *p_demux, int i_query, va_list args );
int E_(Import_GVP)( vlc_object_t *p_this )
{
demux_t *p_demux = (demux_t *)p_this;
int i_peek, i, b_found = VLC_FALSE;
byte_t *p_peek;
stream_Peek( p_demux->s, &p_peek, MAX_LINE );
if( !strstr( p_peek, "gvp_version:" ) )
i_peek = stream_Peek( p_demux->s, &p_peek, MAX_LINE );
for( i = 0; i < i_peek - (int)sizeof("gvp_version:"); i++ )
{
return VLC_EGENERIC;
if( p_peek[i] == 'g' && p_peek[i+1] == 'v' && p_peek[i+2] == 'p' &&
!memcmp( p_peek, "gvp_version:", sizeof("gvp_version:") - 1 ) )
{
b_found = VLC_TRUE;
break;
}
}
if( !b_found ) return VLC_EGENERIC;
STANDARD_DEMUX_INIT_MSG( "using Google Video Playlist (gvp) import" )
p_demux->pf_control = Control;
p_demux->pf_demux = Demux;
......
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