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

Git pushed a commit to branch master
in repository ffmpeg.

commit dc88946d7b6093d7663f4c695aedb841660643c5
Author:     Niklas Haas <[email protected]>
AuthorDate: Thu Mar 26 23:49:31 2026 +0100
Commit:     Niklas Haas <[email protected]>
CommitDate: Sat Mar 28 18:50:14 2026 +0100

    swscale/ops_dispatch: fix plane width calculation
    
    This was wrong if sub_x > 1.
    
    Sponsored-by: Sovereign Tech Fund
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/ops_dispatch.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libswscale/ops_dispatch.c b/libswscale/ops_dispatch.c
index f6dfddd57e..774a7e5641 100644
--- a/libswscale/ops_dispatch.c
+++ b/libswscale/ops_dispatch.c
@@ -156,8 +156,8 @@ static int op_pass_setup(const SwsFrame *out, const 
SwsFrame *in,
         const int chroma     = idx == 1 || idx == 2;
         const int sub_x      = chroma ? indesc->log2_chroma_w : 0;
         const int sub_y      = chroma ? indesc->log2_chroma_h : 0;
-        const int plane_w    = (aligned_w + sub_x) >> sub_x;
-        const int plane_pad  = (comp->over_read + sub_x) >> sub_x;
+        const int plane_w    = AV_CEIL_RSHIFT(aligned_w, sub_x);
+        const int plane_pad  = AV_CEIL_RSHIFT(comp->over_read, sub_x);
         const int plane_size = plane_w * p->pixel_bits_in >> 3;
         const int total_size = plane_size + plane_pad;
         const int loop_size  = num_blocks * exec->block_size_in;
@@ -178,8 +178,8 @@ static int op_pass_setup(const SwsFrame *out, const 
SwsFrame *in,
         const int chroma     = idx == 1 || idx == 2;
         const int sub_x      = chroma ? outdesc->log2_chroma_w : 0;
         const int sub_y      = chroma ? outdesc->log2_chroma_h : 0;
-        const int plane_w    = (aligned_w + sub_x) >> sub_x;
-        const int plane_pad  = (comp->over_write + sub_x) >> sub_x;
+        const int plane_w    = AV_CEIL_RSHIFT(aligned_w, sub_x);
+        const int plane_pad  = AV_CEIL_RSHIFT(comp->over_write, sub_x);
         const int plane_size = plane_w * p->pixel_bits_out >> 3;
         const int loop_size  = num_blocks * exec->block_size_out;
         p->memcpy_out |= plane_size + plane_pad > FFABS(out->linesize[idx]);

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

Reply via email to