aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-06-08 19:43:15 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-07-07 23:36:31 +0200
commitc8200d382503f5fd839a72af7ba93d53880ad4b7 (patch)
treeab32823308f78097a1c22b41626c96966dc5e979 /libavformat
parent498ce4e8b82e2312690613df45f87e592dcb91a9 (diff)
downloadffmpeg-c8200d382503f5fd839a72af7ba93d53880ad4b7.tar.gz
avformat/rtsp: Check that lower transport is handled in one of the if()
Fixes: CID1473554 Uninitialized scalar variable Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/rtsp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index c6fca89d83..19b93df839 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1578,7 +1578,11 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
else if (lower_transport == RTSP_LOWER_TRANSPORT_UDP_MULTICAST) {
snprintf(transport, sizeof(transport) - 1,
"%s/UDP;multicast", trans_pref);
+ } else {
+ err = AVERROR(EINVAL);
+ goto fail; // transport would be uninitialized
}
+
if (s->oformat) {
av_strlcat(transport, ";mode=record", sizeof(transport));
} else if (rt->server_type == RTSP_SERVER_REAL ||