This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch release/9.0 in repository ffmpeg.
commit 1b9584f7e8e0d6ed684459416f3cf148967bb1a9 Author: Thomas Devoogdt <[email protected]> AuthorDate: Thu Jul 16 19:26:50 2026 +0200 Commit: Michael Niedermayer <[email protected]> CommitDate: Tue Nov 24 19:55:14 2026 +0100 avformat/rtpdec: propagate SRTP setup errors to the caller ff_rtp_parse_set_crypto() was void and dropped the ff_srtp_set_crypto() return value. A rejected crypto suite therefore left srtp_enabled clear while RTSPStream.crypto_suite stayed set, and rtsp.c uses crypto_suite[0] as the sole guard for secure transport. The session could thus be negotiated as SRTP while the RTP actually went out unprotected. Return the error instead and let ff_rtsp_open_transport_ctx() abort SETUP rather than continue with a half-initialised SRTP context. Signed-off-by: Thomas Devoogdt <[email protected]> (cherry picked from commit 9cf34b031f489dcecad5c579d0a22a956918cf36) Signed-off-by: Michael Niedermayer <[email protected]> --- libavformat/rtpdec.c | 11 +++++++---- libavformat/rtpdec.h | 4 ++-- libavformat/rtsp.c | 15 +++++++++++---- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c index 88ec01bcc0..13f4b78a80 100644 --- a/libavformat/rtpdec.c +++ b/libavformat/rtpdec.c @@ -584,11 +584,14 @@ void ff_rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx, s->handler = handler; } -void ff_rtp_parse_set_crypto(RTPDemuxContext *s, const char *suite, - const char *params) +int ff_rtp_parse_set_crypto(RTPDemuxContext *s, const char *suite, + const char *params) { - if (!ff_srtp_set_crypto(&s->srtp, suite, params)) - s->srtp_enabled = 1; + int ret = ff_srtp_set_crypto(&s->srtp, suite, params); + if (ret < 0) + return ret; + s->srtp_enabled = 1; + return 0; } static int rtp_set_prft(RTPDemuxContext *s, AVPacket *pkt, uint32_t timestamp) { diff --git a/libavformat/rtpdec.h b/libavformat/rtpdec.h index c06f44b86c..0c2a293c9b 100644 --- a/libavformat/rtpdec.h +++ b/libavformat/rtpdec.h @@ -45,8 +45,8 @@ RTPDemuxContext *ff_rtp_parse_open(AVFormatContext *s1, AVStream *st, int payload_type, int queue_size); void ff_rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx, const RTPDynamicProtocolHandler *handler); -void ff_rtp_parse_set_crypto(RTPDemuxContext *s, const char *suite, - const char *params); +int ff_rtp_parse_set_crypto(RTPDemuxContext *s, const char *suite, + const char *params); int ff_rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt, uint8_t **buf, int len); void ff_rtp_parse_close(RTPDemuxContext *s); diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 956a80fc86..e9dd730d24 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -925,10 +925,17 @@ int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st) rtsp_st->dynamic_protocol_context, rtsp_st->dynamic_handler); } - if (rtsp_st->crypto_suite[0]) - ff_rtp_parse_set_crypto(rtsp_st->transport_priv, - rtsp_st->crypto_suite, - rtsp_st->crypto_params); + if (rtsp_st->crypto_suite[0]) { + int ret = ff_rtp_parse_set_crypto(rtsp_st->transport_priv, + rtsp_st->crypto_suite, + rtsp_st->crypto_params); + if (ret < 0) { + av_log(s, AV_LOG_ERROR, + "SRTP setup failed for suite '%s'\n", + rtsp_st->crypto_suite); + return ret; + } + } } return 0; -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
