Commit 172d71c4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

I had missed a third similar problem

parent 81dd5aa6
...@@ -912,7 +912,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt ) ...@@ -912,7 +912,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
if( p_sys->psz_destination ) if( p_sys->psz_destination )
{ {
char access[17]; char access[17];
char url[NI_MAXHOST + 7]; char url[NI_MAXHOST + 8];
/* first try to create the access out */ /* first try to create the access out */
if( p_sys->i_ttl > 0 ) if( p_sys->i_ttl > 0 )
...@@ -924,8 +924,8 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt ) ...@@ -924,8 +924,8 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
else else
strcpy( access, "udp{raw}" ); strcpy( access, "udp{raw}" );
snprintf( url, sizeof( url ), snprintf( url, sizeof( url ), (( p_sys->psz_destination[0] != '[' ) &&
strchr( p_sys->psz_destination, ':' ) ? "[%s]:%d" : "%s:%d", strchr( p_sys->psz_destination, ':' )) ? "[%s]:%d" : "%s:%d",
p_sys->psz_destination, i_port ); p_sys->psz_destination, i_port );
url[sizeof( url ) - 1] = '\0'; url[sizeof( url ) - 1] = '\0';
...@@ -1641,10 +1641,7 @@ static int RtspCallbackId( httpd_callback_sys_t *p_args, ...@@ -1641,10 +1641,7 @@ static int RtspCallbackId( httpd_callback_sys_t *p_args,
else if( strstr( psz_transport, "unicast" ) && strstr( psz_transport, "client_port=" ) ) else if( strstr( psz_transport, "unicast" ) && strstr( psz_transport, "client_port=" ) )
{ {
int i_port = atoi( strstr( psz_transport, "client_port=" ) + strlen("client_port=") ); int i_port = atoi( strstr( psz_transport, "client_port=" ) + strlen("client_port=") );
char ip[NI_MAXNUMERICHOST]; char ip[NI_MAXNUMERICHOST], psz_access[17], psz_url[NI_MAXNUMERICHOST + 8];
char psz_access[100];
char psz_url[100];
sout_access_out_t *p_access; sout_access_out_t *p_access;
...@@ -1685,10 +1682,15 @@ static int RtspCallbackId( httpd_callback_sys_t *p_args, ...@@ -1685,10 +1682,15 @@ static int RtspCallbackId( httpd_callback_sys_t *p_args,
/* first try to create the access out */ /* first try to create the access out */
if( p_sys->i_ttl > 0 ) if( p_sys->i_ttl > 0 )
sprintf( psz_access, "udp{raw,ttl=%d}", p_sys->i_ttl ); snprintf( psz_access, sizeof( psz_access ),
"udp{raw,ttl=%d}", p_sys->i_ttl );
else else
sprintf( psz_access, "udp{raw}" ); strncpy( psz_access, "udp{raw}", sizeof( psz_access ) );
sprintf( psz_url, "%s:%d", ip, i_port ); psz_access[sizeof( psz_access ) - 1] = '\0';
snprintf( psz_url, sizeof( psz_url ),
( strchr( ip, ':' ) != NULL ) ? "[%s]:%d" : "%s:%d",
ip, i_port );
if( ( p_access = sout_AccessOutNew( p_stream->p_sout, psz_access, psz_url ) ) == NULL ) if( ( p_access = sout_AccessOutNew( p_stream->p_sout, psz_access, psz_url ) ) == NULL )
{ {
......
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