avformat/rtsp: initialize reply1

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>
This commit is contained in:
Michael Niedermayer 2024-06-08 18:28:49 +02:00
parent 9bb38ba2b7
commit 498ce4e8b8
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 2 additions and 0 deletions

View File

@ -1462,6 +1462,8 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
char cmd[MAX_URL_SIZE]; char cmd[MAX_URL_SIZE];
const char *trans_pref; const char *trans_pref;
memset(&reply1, 0, sizeof(reply1));
if (rt->transport == RTSP_TRANSPORT_RDT) if (rt->transport == RTSP_TRANSPORT_RDT)
trans_pref = "x-pn-tng"; trans_pref = "x-pn-tng";
else if (rt->transport == RTSP_TRANSPORT_RAW) else if (rt->transport == RTSP_TRANSPORT_RAW)