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

Don't return negative session number

parent 35754aba
...@@ -499,7 +499,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -499,7 +499,7 @@ static int Open( vlc_object_t *p_this )
asprintf( &p_sys->psz_sdp, asprintf( &p_sys->psz_sdp,
"v=0\r\n" "v=0\r\n"
/* FIXME: source address not known :( */ /* FIXME: source address not known :( */
"o=- "I64Fd" %d IN IP%c %s\r\n" "o=- "I64Fu" %d IN IP%c %s\r\n"
"s=%s\r\n" "s=%s\r\n"
"i=%s\r\n" "i=%s\r\n"
"u=%s\r\n" "u=%s\r\n"
...@@ -771,7 +771,7 @@ char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url ) ...@@ -771,7 +771,7 @@ char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url )
p = psz_sdp = malloc( i_size ); p = psz_sdp = malloc( i_size );
p += sprintf( p, "v=0\r\n" ); p += sprintf( p, "v=0\r\n" );
p += sprintf( p, "o=- "I64Fd" %d IN IP%c %s\r\n", p += sprintf( p, "o=- "I64Fu" %d IN IP%c %s\r\n",
p_sys->i_sdp_id, p_sys->i_sdp_version, p_sys->i_sdp_id, p_sys->i_sdp_version,
ipv, ipv == '6' ? "::1" : "127.0.0.1" ); ipv, ipv == '6' ? "::1" : "127.0.0.1" );
if( *p_sys->psz_session_name ) if( *p_sys->psz_session_name )
......
...@@ -439,7 +439,7 @@ static int RtspCallbackId( httpd_callback_sys_t *p_args, ...@@ -439,7 +439,7 @@ static int RtspCallbackId( httpd_callback_sys_t *p_args,
if( psz_session == NULL ) if( psz_session == NULL )
{ {
/* FIXME: should be somewhat secure randomness */ /* FIXME: should be somewhat secure randomness */
snprintf( psz_session_init, sizeof(psz_session_init), I64Fd, snprintf( psz_session_init, sizeof(psz_session_init), I64Fu,
NTPtime64() + rand() ); NTPtime64() + rand() );
} }
......
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