aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-01-28 00:53:22 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-03-24 10:39:03 +0100
commite5ea21a58063e1628a2892ed76e5725ba0bfd0cd (patch)
tree673a3e4686a4087f578600f91e7759da7f9b0927
parent20337eb1068049692f0c1f9c8a924ca127cdae77 (diff)
downloadffmpeg-e5ea21a58063e1628a2892ed76e5725ba0bfd0cd.tar.gz
avformat/rtsp: Clear reply in every iteration in ff_rtsp_connect()
Fixes: Infinite loop Found-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Michael Hanselmann <public@hansmi.ch> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 0b50f27635f684ec0526e9975c9979f35bbf486b) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/rtsp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index c6292c5543..a3f1e40983 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1659,7 +1659,7 @@ int ff_rtsp_connect(AVFormatContext *s)
char tcpname[1024], cmd[2048], auth[128];
const char *lower_rtsp_proto = "tcp";
int port, err, tcp_fd;
- RTSPMessageHeader reply1 = {0}, *reply = &reply1;
+ RTSPMessageHeader reply1, *reply = &reply1;
int lower_transport_mask = 0;
int default_port = RTSP_DEFAULT_PORT;
char real_challenge[64] = "";
@@ -1688,6 +1688,7 @@ int ff_rtsp_connect(AVFormatContext *s)
rt->lower_transport_mask &= (1 << RTSP_LOWER_TRANSPORT_NB) - 1;
redirect:
+ memset(&reply1, 0, sizeof(reply1));
/* extract hostname and port */
av_url_split(proto, sizeof(proto), auth, sizeof(auth),
host, sizeof(host), &port, path, sizeof(path), s->filename);