Commit 96e4e5f4 authored by Jérôme Decoodt's avatar Jérôme Decoodt
Browse files

Avoid segfaulting if live555 error is neither a HTTP or RTSP error

Avoid an infinite loop for this case too (only 3 tries to connect, then abort)
parent 0a7905f6
...@@ -486,7 +486,9 @@ static int Connect( demux_t *p_demux ) ...@@ -486,7 +486,9 @@ static int Connect( demux_t *p_demux )
psz_pwd = var_CreateGetString( p_demux, "rtsp-pwd" ); psz_pwd = var_CreateGetString( p_demux, "rtsp-pwd" );
} }
int i_lefttries = 3;
createnew: createnew:
i_lefttries--;
if( p_demux->b_die || p_demux->b_error ) if( p_demux->b_die || p_demux->b_error )
{ {
free( psz_user ); free( psz_user );
...@@ -546,7 +548,10 @@ describe: ...@@ -546,7 +548,10 @@ describe:
else else
{ {
const char *psz_tmp = strstr( psz_error, "RTSP" ); const char *psz_tmp = strstr( psz_error, "RTSP" );
sscanf( psz_tmp, "RTSP/%*s%3u", &i_code ); if( psz_tmp )
sscanf( psz_tmp, "RTSP/%*s%3u", &i_code );
else
i_code = 0;
} }
msg_Dbg( p_demux, "DESCRIBE failed with %d: %s", i_code, psz_error ); msg_Dbg( p_demux, "DESCRIBE failed with %d: %s", i_code, psz_error );
...@@ -593,7 +598,8 @@ describe: ...@@ -593,7 +598,8 @@ describe:
msg_Dbg( p_demux, "connection timeout, retrying" ); msg_Dbg( p_demux, "connection timeout, retrying" );
if( p_sys->rtsp ) RTSPClient::close( p_sys->rtsp ); if( p_sys->rtsp ) RTSPClient::close( p_sys->rtsp );
p_sys->rtsp = NULL; p_sys->rtsp = NULL;
goto createnew; if( i_lefttries > 0 )
goto createnew;
} }
i_ret = VLC_EGENERIC; i_ret = VLC_EGENERIC;
} }
......
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