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

Git pushed a commit to branch release/8.1
in repository ffmpeg.

commit a3504f6e228cf111553f5d9fa0db6890758b99cc
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Mon Sep 14 02:23:52 2026 +0200
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Sat Sep 19 14:27:15 2026 +0200

    avcodec/dvdsubenc: account for the byte alignment of each RLE line
    
    Fixes: m46RwJIzh7AQ
    Fixes: out of array write
    Found-by: Zheng Yu @ Depthfirst
    (cherry picked from commit 8702f12c9daa199cc4d7c17164b13c3cdcdc2436)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/dvdsubenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dvdsubenc.c b/libavcodec/dvdsubenc.c
index 2a5463b8d8..0747c43c31 100644
--- a/libavcodec/dvdsubenc.c
+++ b/libavcodec/dvdsubenc.c
@@ -340,8 +340,8 @@ static int dvdsub_encode(AVCodecContext *avctx,
     // encode data block
     q = outbuf + 4;
     offset1 = q - outbuf;
-    // worst case memory requirement: 1 nibble per pixel..
-    if ((q - outbuf) + vrect.w * vrect.h / 2 + 17 + 21 > outbuf_size) {
+    // worst case memory requirement: 1 nibble per pixel, lines are byte 
aligned
+    if ((q - outbuf) + vrect.h * ((vrect.w + 1) / 2) + 17 + 21 > outbuf_size) {
         av_log(NULL, AV_LOG_ERROR, "dvd_subtitle too big\n");
         ret = AVERROR_BUFFER_TOO_SMALL;
         goto fail;

-- 
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