Commit 71e657ce authored by Gildas Bazin's avatar Gildas Bazin

* modules/demux/sgimb.c: fixed memory leak.

parent 67562c1a
......@@ -107,8 +107,23 @@ static int Activate( vlc_object_t * p_this )
byte_t *p_peek;
int i_size;
/* Lets check the content to see if this is a sgi mediabase file */
i_size = stream_Peek( p_demux->s, &p_peek, MAX_LINE );
i_size -= sizeof("sgiNameServerHost=") - 1;
if ( i_size > 0 )
{
while ( i_size && strncasecmp( p_peek, "sgiNameServerHost=",
sizeof("sgiNameServerHost=") - 1 ) )
{
p_peek++;
i_size--;
}
if ( !strncasecmp( p_peek, "sgiNameServerHost=",
sizeof("sgiNameServerHost=") -1 ) )
{
p_demux->pf_demux = Demux;
p_demux->pf_control = Control;
p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
p_sys->psz_uri = NULL;
p_sys->psz_server = NULL;
......@@ -119,22 +134,9 @@ static int Activate( vlc_object_t * p_this )
p_sys->psz_mcast_ip = NULL;
p_sys->i_mcast_port = 0;
p_sys->i_packet_size = 0;
p_sys->i_duration = (mtime_t)0;
p_sys->i_duration = 0;
p_sys->i_port = 0;
/* Lets check the content to see if this is a sgi mediabase file */
i_size = stream_Peek( p_demux->s, &p_peek, MAX_LINE );
i_size -= sizeof("sgiNameServerHost=") - 1;
if ( i_size > 0 ) {
while ( i_size
&& strncasecmp( p_peek, "sgiNameServerHost=", sizeof("sgiNameServerHost=") - 1 ) )
{
p_peek++;
i_size--;
}
if ( !strncasecmp( p_peek, "sgiNameServerHost=", sizeof("sgiNameServerHost=") -1 ) )
{
return VLC_SUCCESS;
}
}
......
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