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

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

commit d8403d0bc788c14d2dc696bedb1f04682eab4bad
Author:     Baptiste Coudurier <[email protected]>
AuthorDate: Tue Nov 10 23:38:24 2026 -0800
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Thu Nov 19 14:56:30 2026 +0100

    avcodec/libx264: size the mb_info map for interlaced encoding
    
    x264 reads mb_info over a row count rounded up to even when interlaced,
    so an odd macroblock row count read past the map.
    
    Found during review of #25909 by Forgejo_Fairy.
    
    Signed-off-by: Baptiste Coudurier <[email protected]>
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    (cherry picked from commit 0936e701b4d08ec47d30b6cc67b77c2549172b85)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/libx264.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index a432c0b50e..e5a853c10a 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -370,7 +370,10 @@ static int setup_mb_info(AVCodecContext *ctx, 
x264_picture_t *pic,
     mbinfo_rects = (const AVVideoRect *)av_video_hint_rects(info);
     nb_rects = info->nb_rects;
 
-    mbinfo = av_calloc(mb_width * mb_height, sizeof(*mbinfo));
+    /* x264 rounds the macroblock row count up to an even number for
+     * interlaced and fake-interlaced encoding and reads mb_info over
+     * that grid, so size the map for it. The extra row stays 0. */
+    mbinfo = av_calloc(mb_width * FFALIGN(mb_height, 2), sizeof(*mbinfo));
     if (!mbinfo)
         return AVERROR(ENOMEM);
 

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