This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 8bd5594a0f81604457f327f4b6a116c017566e86
Author:     Jack Lau <[email protected]>
AuthorDate: Sun Nov 16 14:59:40 2025 +0800
Commit:     Jack Lau <[email protected]>
CommitDate: Mon Jan 19 21:37:17 2026 +0800

    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 9ed5b1f2a3..5200aca4fd 100644
--- a/libavformat/whip.c
+++ b/libavformat/whip.c
@@ -336,11 +336,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;
 }
 
 

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to