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

Git pushed a commit to branch master
in repository ffmpeg.

commit 2eb254c5fd5c93a41f68db873ac52cff6904f966
Author:     Niklas Haas <[email protected]>
AuthorDate: Wed Jun 17 18:35:51 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Tue Jun 23 11:48:13 2026 +0000

    swscale/ops_dispatch: avoid possible infinite recursion
    
    If the filter cannot actually be optimized into the read (for whatever
    reason), this code would previously loop infinitely. Bail out cleanly
    instead.
    
    The FFSWAP is there to make the error message print the remainder (the one
    containing unsplittable ops), rather than the noop list.
    
    Sponsored-by: Sovereign Tech Fund
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/ops_dispatch.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libswscale/ops_dispatch.c b/libswscale/ops_dispatch.c
index efb00233e6..a0a23185a8 100644
--- a/libswscale/ops_dispatch.c
+++ b/libswscale/ops_dispatch.c
@@ -688,6 +688,13 @@ static int compile_subpass(const CompileArgs *args, 
SwsOpList **pops,
         const SwsOp *op = &ops->ops[idx];
         if (op->op == SWS_OP_FILTER_H || op->op == SWS_OP_FILTER_V) {
             RET(ff_sws_op_list_split_at(ops, &rest, idx));
+            if (ff_sws_op_list_is_noop(ops)) {
+                /* Prevent infinite recursion by avoiding splitting in a way
+                 * that does not meaningfully reduce the number of operations
+                 * performed in the second part. */
+                FFSWAP(SwsOpList *, ops, rest);
+                break;
+            }
             /* Serial split: feed first pass into second */
             RET(compile_subpass(args, &ops,  input, &tmp));
             RET(compile_subpass(args, &rest, tmp, output));

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

Reply via email to