PR #20955 opened by Jack Lau (JackLau) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20955 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20955.patch
>From 837b0dd8d96c6f258bbccdfe5e05b40ebabf249a Mon Sep 17 00:00:00 2001 From: Jack Lau <[email protected]> Date: Sat, 15 Nov 2025 19:23:39 +0800 Subject: [PATCH 1/3] avfotmat/whip: remove ssl_error_message since it's no longer in use Signed-off-by: Jack Lau <[email protected]> --- libavformat/whip.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavformat/whip.c b/libavformat/whip.c index 6a9b208f69..52f6d32bab 100644 --- a/libavformat/whip.c +++ b/libavformat/whip.c @@ -300,8 +300,6 @@ typedef struct WHIPContext { */ uint8_t dtls_srtp_materials[(DTLS_SRTP_KEY_LEN + DTLS_SRTP_SALT_LEN) * 2]; - char ssl_error_message[256]; - /* TODO: Use AVIOContext instead of URLContext */ URLContext *dtls_uc; -- 2.49.1 >From b1fd3386f090480581689b39356fe26a56599c3d Mon Sep 17 00:00:00 2001 From: Jack Lau <[email protected]> Date: Sat, 15 Nov 2025 21:27:31 +0800 Subject: [PATCH 2/3] avformat/whip: fix parameter order of ELAPSED Signed-off-by: Jack Lau <[email protected]> --- libavformat/whip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/whip.c b/libavformat/whip.c index 52f6d32bab..22f7ab8e7a 100644 --- a/libavformat/whip.c +++ b/libavformat/whip.c @@ -1932,7 +1932,7 @@ write_packet: if (now - whip->whip_last_consent_rx_time > WHIP_ICE_CONSENT_EXPIRED_TIMER * WHIP_US_PER_MS) { av_log(whip, AV_LOG_ERROR, "Consent Freshness expired after %.2fms (limited %dms), terminate session\n", - ELAPSED(now, whip->whip_last_consent_rx_time), WHIP_ICE_CONSENT_EXPIRED_TIMER); + ELAPSED(whip->whip_last_consent_rx_time, now), WHIP_ICE_CONSENT_EXPIRED_TIMER); ret = AVERROR(ETIMEDOUT); goto end; } -- 2.49.1 >From 59c726478ee5a9f424e4b4c00e6ef3534948118f Mon Sep 17 00:00:00 2001 From: Jack Lau <[email protected]> Date: Sun, 16 Nov 2025 14:59:40 +0800 Subject: [PATCH 3/3] avformat/whip: fix potential out of bound read in is_dtls_packet Signed-off-by: Jack Lau <[email protected]> --- libavformat/whip.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libavformat/whip.c b/libavformat/whip.c index 22f7ab8e7a..84ab36b506 100644 --- a/libavformat/whip.c +++ b/libavformat/whip.c @@ -337,11 +337,15 @@ typedef struct WHIPContext { /** * Whether the packet is a DTLS packet. */ -static int is_dtls_packet(uint8_t *b, int size) { - uint16_t version = AV_RB16(&b[1]); - return size > DTLS_RECORD_LAYER_HEADER_LEN && - b[0] >= DTLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC && - (version == DTLS_VERSION_10 || version == DTLS_VERSION_12); +static int is_dtls_packet(uint8_t *b, int size) +{ + int ret = 0; + if (size > DTLS_RECORD_LAYER_HEADER_LEN) { + uint16_t version = AV_RB16(&b[1]); + ret = b[0] >= DTLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC && + (version == DTLS_VERSION_10 || version == DTLS_VERSION_12); + } + return ret; } -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
