diff mbox series

[FFmpeg-devel,3/9] avformat/rtsp: initialize reply1

Message ID 20240608231046.3619551-3-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/9] avformat/rtpenc_vc2hq: Check sizes | expand


Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer June 8, 2024, 11:10 p.m. UTC
It seems reply1 is initialized by ff_rtsp_send_cmd() in most cases but there
are code paths like "continue" which look like they could skip it but even if not
writing this so a complex loop after several layers of calls initialized a local
variable through a pointer is just bad design.
This patch simply initialized the variable.

Fixes: CID1473532 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
 libavformat/rtsp.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series


diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 28c858077ad..c6fca89d83f 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1462,6 +1462,8 @@  int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
     char cmd[MAX_URL_SIZE];
     const char *trans_pref;
+    memset(&reply1, 0, sizeof(reply1));
     if (rt->transport == RTSP_TRANSPORT_RDT)
         trans_pref = "x-pn-tng";
     else if (rt->transport == RTSP_TRANSPORT_RAW)