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

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 71478d1165 avformat/rtpenc_amr: Check input size
71478d1165 is described below

commit 71478d11658d8a6f38138b6621061b8c6f2e5074
Author:     jiale yao <[email protected]>
AuthorDate: Fri Jun 12 17:26:09 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Sun Jun 14 15:32:48 2026 +0000

    avformat/rtpenc_amr: Check input size
    
    Fixes: heap buffer overflow
    
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavformat/rtpenc_amr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/rtpenc_amr.c b/libavformat/rtpenc_amr.c
index 8df5a3cf3e..60356ac984 100644
--- a/libavformat/rtpenc_amr.c
+++ b/libavformat/rtpenc_amr.c
@@ -34,6 +34,10 @@ void ff_rtp_send_amr(AVFormatContext *s1, const uint8_t 
*buff, int size)
     int max_header_toc_size   = 1 + s->max_frames_per_packet;
     uint8_t *p;
     int len;
+    int max_size = st->codecpar->codec_id == AV_CODEC_ID_AMR_NB ? 32 : 61;
+
+    if (size < 1 || size > max_size)
+        return;
 
     /* Test if the packet must be sent. */
     len = s->buf_ptr - s->buf;

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

Reply via email to