1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-13 21:28:01 +02:00

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>
(cherry picked from commit c8200d3825)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-06-08 19:43:15 +02:00
parent 6c21843037
commit 4d958c1e5a
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -1575,7 +1575,11 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
else if (lower_transport == RTSP_LOWER_TRANSPORT_UDP_MULTICAST) { else if (lower_transport == RTSP_LOWER_TRANSPORT_UDP_MULTICAST) {
snprintf(transport, sizeof(transport) - 1, snprintf(transport, sizeof(transport) - 1,
"%s/UDP;multicast", trans_pref); "%s/UDP;multicast", trans_pref);
} else {
err = AVERROR(EINVAL);
goto fail; // transport would be uninitialized
} }
if (s->oformat) { if (s->oformat) {
av_strlcat(transport, ";mode=record", sizeof(transport)); av_strlcat(transport, ";mode=record", sizeof(transport));
} else if (rt->server_type == RTSP_SERVER_REAL || } else if (rt->server_type == RTSP_SERVER_REAL ||