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

Git pushed a commit to branch master
in repository ffmpeg.

commit 1ab6511a16076cbef2375f842b17cd38cc226720
Author:     Niklas Haas <[email protected]>
AuthorDate: Tue Sep 15 15:49:28 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Sun Sep 20 13:09:12 2026 +0000

    swscale/ops_dispatch: pre-compute pass block count
    
    This depends only on the compiled op and output size, which are known in
    advance.
    
    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 1ec8c1e85a..e0d0d34b31 100644
--- a/libswscale/ops_dispatch.c
+++ b/libswscale/ops_dispatch.c
@@ -218,11 +218,8 @@ static int op_pass_setup(const SwsFrame *out, const 
SwsFrame *in,
 
     /* Set up main loop parameters */
     const unsigned block_size = comp->block_size;
-    const size_t num_blocks   = (width + block_size - 1) / block_size;
+    const size_t num_blocks   = p->num_blocks;
     const size_t aligned_w    = num_blocks * block_size;
-    if (aligned_w < width) /* overflow */
-        return AVERROR(EINVAL);
-    p->num_blocks   = num_blocks;
     p->memcpy_first = false;
     p->memcpy_last  = false;
     p->memcpy_out   = false;
@@ -595,6 +592,9 @@ static int compile_single(const CompileArgs *args, const 
SwsOpList *ops,
     p->planes_out     = rw_data_planes(write);
     p->pixel_bits_out = rw_pixel_bits(write);
     p->palette_idx    = -1;
+    p->num_blocks     = (dst->width + comp->block_size - 1) / comp->block_size;
+    if (p->num_blocks * comp->block_size < (unsigned) dst->width)
+        return AVERROR(ERANGE);
 
     SwsOpExec *exec = &p->exec_base;
     *exec = (SwsOpExec) {

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