* [FFmpeg-devel] [PATCH] avformat/whip: several fixes (PR #20955)
@ 2025-11-18 14:11 Jack Lau via ffmpeg-devel
0 siblings, 0 replies; only message in thread
From: Jack Lau via ffmpeg-devel @ 2025-11-18 14:11 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Jack Lau
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 <jacklau1222gm@gmail.com>
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 <jacklau1222gm@gmail.com>
---
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 <jacklau1222gm@gmail.com>
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 <jacklau1222gm@gmail.com>
---
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 <jacklau1222gm@gmail.com>
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 <jacklau1222gm@gmail.com>
---
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 -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-11-18 14:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-18 14:11 [FFmpeg-devel] [PATCH] avformat/whip: several fixes (PR #20955) Jack Lau via ffmpeg-devel
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git