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

Git pushed a commit to branch master
in repository ffmpeg.

commit 6df8174f7758a66837f3c9ed9986d0c51a818ace
Author:     Niklas Haas <[email protected]>
AuthorDate: Tue Jan 13 11:19:00 2026 +0100
Commit:     Niklas Haas <[email protected]>
CommitDate: Thu Feb 19 19:44:46 2026 +0000

    swscale/optimizer: don't reject op lists without read
    
    When splitting planes, some planes can end up without a read operation
    altogether, e.g. when just clearing the alpha plane.
    
    Just return ENOTSUP for such lists instead of EINVAL.
    
    Also fixes the !ops->num_ops check to avoid UB.
    
    Sponsored-by: Sovereign Tech Fund
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/ops_optimizer.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libswscale/ops_optimizer.c b/libswscale/ops_optimizer.c
index 9aaca80408..9e6817ffcc 100644
--- a/libswscale/ops_optimizer.c
+++ b/libswscale/ops_optimizer.c
@@ -645,13 +645,15 @@ int ff_sws_solve_shuffle(const SwsOpList *const ops, 
uint8_t shuffle[],
                          int size, uint8_t clear_val,
                          int *read_bytes, int *write_bytes)
 {
+    if (!ops->num_ops)
+        return AVERROR(EINVAL);
+
     const SwsOp read = ops->ops[0];
     const int read_size = ff_sws_pixel_type_size(read.type);
     uint32_t mask[4] = {0};
 
-    if (!ops->num_ops || read.op != SWS_OP_READ)
-        return AVERROR(EINVAL);
-    if (read.rw.frac || (!read.rw.packed && read.rw.elems > 1))
+    if (read.op != SWS_OP_READ || read.rw.frac ||
+        (!read.rw.packed && read.rw.elems > 1))
         return AVERROR(ENOTSUP);
 
     for (int i = 0; i < read.rw.elems; i++)

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

Reply via email to