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

Git pushed a commit to branch master
in repository ffmpeg.

commit dba7b81b3862ad38e471ab92a9c577f7ae0eac3f
Author:     Niklas Haas <[email protected]>
AuthorDate: Tue Apr 14 16:25:03 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Thu Apr 16 20:59:39 2026 +0000

    swscale/ops_dispatch: avoid calling comp->func with w=0
    
    The x86 kernel e.g. assumes that at least one block is processed; so avoid
    calling this with an empty width. This is currently only possible if e.g.
    operating on an unpadded, very small image whose total linesize is less than
    a single block.
    
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/ops_dispatch.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/libswscale/ops_dispatch.c b/libswscale/ops_dispatch.c
index 45bd194c77..fa24283db2 100644
--- a/libswscale/ops_dispatch.c
+++ b/libswscale/ops_dispatch.c
@@ -340,15 +340,17 @@ static void op_pass_run(const SwsFrame *out, const 
SwsFrame *in, const int y,
 
     /* Non-aligned case (slow path); process num_blocks - 1 main blocks and
      * a separate tail (via memcpy into an appropriately padded buffer) */
-    for (int i = 0; i < 4; i++) {
-        /* We process one fewer block, so the in_bump needs to be increased
-         * to reflect that the plane pointers are left on the last block,
-         * not the end of the processed line, after each loop iteration */
-        exec.in_bump[i]  += exec.block_size_in;
-        exec.out_bump[i] += exec.block_size_out;
-    }
+    if (num_blocks > 1) {
+        for (int i = 0; i < 4; i++) {
+            /* We process one fewer block, so the in_bump needs to be increased
+             * to reflect that the plane pointers are left on the last block,
+             * not the end of the processed line, after each loop iteration */
+            exec.in_bump[i]  += exec.block_size_in;
+            exec.out_bump[i] += exec.block_size_out;
+        }
 
-    comp->func(&exec, comp->priv, 0, y, num_blocks - 1, y + h);
+        comp->func(&exec, comp->priv, 0, y, num_blocks - 1, y + h);
+    }
 
     DECLARE_ALIGNED_32(SwsOpExec, tail) = p->exec_tail;
     tail.slice_y = y;

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

Reply via email to