[vlc-commits] commit: rtp : safety check. ( Sébastien Escudier )
git at videolan.org
git at videolan.org
Fri Jul 9 16:44:20 CEST 2010
vlc/vlc-1.1 | branch: master | Sébastien Escudier <sebastien-devel at celeos.eu> | Thu Jun 24 08:41:16 2010 +0200| [2b37a6fea901ff5fcd6e7f5b2078601f0efe6bff] | committer: Sébastien Escudier
rtp : safety check.
There was a small window of opportunity between RtspSetup and RtspAddId where this can happen.
(cherry picked from commit b445a6a9ffb600e4aa87793c21186d457631d588)
Signed-off-by: Sébastien Escudier <sebastien-devel at celeos.eu>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=2b37a6fea901ff5fcd6e7f5b2078601f0efe6bff
---
modules/stream_out/rtp.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index 245b340..d2e32fd 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -680,9 +680,12 @@ static void SDPHandleUrl( sout_stream_t *p_stream, const char *psz_url )
if( p_sys->p_mux != NULL )
{
sout_stream_id_t *id = p_sys->es[0];
- id->rtsp_id = RtspAddId( p_sys->rtsp, id, GetDWBE( id->ssrc ),
- p_sys->psz_destination, p_sys->i_ttl,
- id->i_port, id->i_port + 1 );
+ rtsp_stream_id_t *rtsp_id = RtspAddId( p_sys->rtsp, id, GetDWBE( id->ssrc ),
+ p_sys->psz_destination, p_sys->i_ttl,
+ id->i_port, id->i_port + 1 );
+ vlc_mutex_lock( &p_sys->lock_es );
+ id->rtsp_id = rtsp_id;
+ vlc_mutex_unlock( &p_sys->lock_es );
}
}
else if( ( url.psz_protocol && !strcasecmp( url.psz_protocol, "sap" ) ) ||
@@ -742,7 +745,7 @@ char *SDPGenerate( sout_stream_t *p_stream, const char *rtsp_url )
int inclport;
vlc_mutex_lock( &p_sys->lock_es );
- if( unlikely(p_sys->i_es == 0) )
+ if( unlikely(p_sys->i_es == 0 || (rtsp_url != NULL && !p_sys->es[0]->rtsp_id)) )
goto out; /* hmm... */
if( p_sys->psz_destination != NULL )
More information about the vlc-commits
mailing list