[vlc-commits] rtp: fix SDP parse error handling
Rémi Denis-Courmont
git at videolan.org
Sun Apr 26 11:06:22 CEST 2020
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Apr 26 12:03:34 2020 +0300| [04eca0590352131902de03fcaa0b3fcd9c61324c] | committer: Rémi Denis-Courmont
rtp: fix SDP parse error handling
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=04eca0590352131902de03fcaa0b3fcd9c61324c
---
modules/access/rtp/rtp.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/modules/access/rtp/rtp.c b/modules/access/rtp/rtp.c
index db2d28ecdc..08c8abcb69 100644
--- a/modules/access/rtp/rtp.c
+++ b/modules/access/rtp/rtp.c
@@ -184,6 +184,14 @@ static int OpenSDP(vlc_object_t *obj)
if (unlikely(sys == NULL))
return VLC_ENOMEM;
+ sys->fd = -1;
+ sys->rtcp_fd = -1;
+ sys->session = NULL;
+#ifdef HAVE_SRTP
+ sys->srtp = NULL;
+#endif
+ sys->thread_ready = false;
+
struct vlc_sdp *sdp = vlc_sdp_parse((const char *)peek, sdplen);
if (sdp == NULL) {
msg_Err(obj, "SDP description parse error");
@@ -284,16 +292,12 @@ static int OpenSDP(vlc_object_t *obj)
vlc_sdp_free(sdp);
sys->chained_demux = NULL;
-#ifdef HAVE_SRTP
- sys->srtp = NULL;
-#endif
sys->fd = fd;
sys->rtcp_fd = rtcp_fd;
sys->max_src = var_InheritInteger(obj, "rtp-max-src");
sys->timeout = vlc_tick_from_sec(var_InheritInteger(obj, "rtp-timeout"));
sys->max_dropout = var_InheritInteger(obj, "rtp-max-dropout");
sys->max_misorder = var_InheritInteger(obj, "rtp-max-misorder");
- sys->thread_ready = false;
sys->autodetect = true;
demux->pf_demux = NULL;
More information about the vlc-commits
mailing list