[FFmpeg-cvslog] avformat/rtsp: Check that lower transport is handled in one of the if()
Michael Niedermayer
git at videolan.org
Wed Jul 24 17:49:24 EEST 2024
ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Sat Jun 8 19:43:15 2024 +0200| [b5129a08fdbd384cced5c78dadfde117a771d147] | committer: Michael Niedermayer
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 at niedermayer.cc>
(cherry picked from commit c8200d382503f5fd839a72af7ba93d53880ad4b7)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b5129a08fdbd384cced5c78dadfde117a771d147
---
libavformat/rtsp.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 55974db24d..52fdbbae52 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1541,7 +1541,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 ||
More information about the ffmpeg-cvslog
mailing list