The branch, master has been updated
       via  d03483bd265b68db00c9b90f6f48dcf61c5c300d (commit)
      from  afd927e0cad63bcca4c4652499dd9a1dea37c4ee (commit)


- Log -----------------------------------------------------------------
commit d03483bd265b68db00c9b90f6f48dcf61c5c300d
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Fri Oct 24 20:29:23 2025 +0200
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Thu Oct 30 01:24:23 2025 +0100

    avformat/rtpenc_h264_hevc: Check space for nal_length_size in 
ff_rtp_send_h264_hevc()
    
    Fixes: memcpy with negative size
    Fixes: momo_trip-poc/input
    
    Reported-by: Momoko Shiraishi <[email protected]>
    Signed-off-by: Michael Niedermayer <[email protected]>

diff --git a/libavformat/rtpenc_h264_hevc.c b/libavformat/rtpenc_h264_hevc.c
index 4d222dca75..38d508fe8f 100644
--- a/libavformat/rtpenc_h264_hevc.c
+++ b/libavformat/rtpenc_h264_hevc.c
@@ -196,6 +196,9 @@ void ff_rtp_send_h264_hevc(AVFormatContext *s1, const 
uint8_t *buf1, int size)
             r1 = ff_nal_mp4_find_startcode(r, end, s->nal_length_size);
             if (!r1)
                 r1 = end;
+            // Check that the last is not truncated
+            if (r1 - r < s->nal_length_size)
+                break;
             r += s->nal_length_size;
         } else {
             while (!*(r++));

-----------------------------------------------------------------------

Summary of changes:
 libavformat/rtpenc_h264_hevc.c | 3 +++
 1 file changed, 3 insertions(+)


hooks/post-receive
-- 

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

Reply via email to