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

Git pushed a commit to branch master
in repository ffmpeg.

commit 7f80b2ad83f37a4998d9617495c92b28a7339a90
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Tue Oct 6 06:49:22 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Sat Oct 10 20:19:56 2026 +0000

    avcodec/dvbsubenc: Account for the full CLUT segment header
    
    Fixes: out of array write
    Fixes: IRdTPagGrTLk
    Heap out of array write Replicated through UnModified FFmpeg with ASAN
    Found-by: Secbuddy, Tencent Keen Security Lab (tested by kvartet)
---
 libavcodec/dvbsubenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dvbsubenc.c b/libavcodec/dvbsubenc.c
index 6f42b1f134..c9ff94c2c0 100644
--- a/libavcodec/dvbsubenc.c
+++ b/libavcodec/dvbsubenc.c
@@ -360,7 +360,7 @@ static int dvbsub_encode(AVCodecContext *avctx, uint8_t 
*outbuf, int buf_size,
                 return AVERROR(EINVAL);
             }
 
-            if (buf_size < 6 + h->rects[clut_id]->nb_colors * 6)
+            if (buf_size < 8 + h->rects[clut_id]->nb_colors * 6)
                 return AVERROR_BUFFER_TOO_SMALL;
 
             /* CLUT segment */
@@ -391,7 +391,7 @@ static int dvbsub_encode(AVCodecContext *avctx, uint8_t 
*outbuf, int buf_size,
             }
 
             bytestream_put_be16(&pseg_len, q - pseg_len - 2);
-            buf_size -= 6 + h->rects[clut_id]->nb_colors * 6;
+            buf_size -= 8 + h->rects[clut_id]->nb_colors * 6;
         }
 
         if (buf_size < h->num_rects * 22)

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to