The branch, master has been updated
       via  a3360c0eafc7733ccfdba6cb109eca41b45a8165 (commit)
      from  9d037c54f209958d47ac376d2a9561608f98dfae (commit)


- Log -----------------------------------------------------------------
commit a3360c0eafc7733ccfdba6cb109eca41b45a8165
Author:     Martin Storsjö <[email protected]>
AuthorDate: Wed Sep 3 14:03:28 2025 +0300
Commit:     Martin Storsjö <[email protected]>
CommitDate: Wed Sep 3 20:18:03 2025 +0000

    swscale: Don't pass a concrete SwsOpPriv as parameter
    
    This fixes the following compiler error, if compiling with MSVC
    for ARM (32 bit):
    
        src/libswscale/ops_chain.c(48): error C2719: 'priv': formal parameter 
with requested alignment of 16 won't be aligned
    
    This change shouldn't affect the performance of this operation
    (which in itself probably isn't relevant); instead of copying the
    contents of the SwsOpPriv struct from the stack as parameter,
    it gets copied straight from the caller function's stack frame
    instead.
    
    Separately from this issue, MSVC 17.8 and 17.9 end up in an
    internal compiler error when compiling libswscale/ops.c, but
    older and newer versions do compile it successfully.

diff --git a/libswscale/ops_chain.c b/libswscale/ops_chain.c
index 5d138a9e46..80162507b0 100644
--- a/libswscale/ops_chain.c
+++ b/libswscale/ops_chain.c
@@ -45,7 +45,7 @@ void ff_sws_op_chain_free(SwsOpChain *chain)
 }
 
 int ff_sws_op_chain_append(SwsOpChain *chain, SwsFuncPtr func,
-                           void (*free)(void *), SwsOpPriv priv)
+                           void (*free)(void *), const SwsOpPriv *priv)
 {
     const int idx = chain->num_impl;
     if (idx == SWS_MAX_OPS)
@@ -53,7 +53,7 @@ int ff_sws_op_chain_append(SwsOpChain *chain, SwsFuncPtr func,
 
     av_assert1(func);
     chain->impl[idx].cont = func;
-    chain->impl[idx + 1].priv = priv;
+    chain->impl[idx + 1].priv = *priv;
     chain->free[idx + 1] = free;
     chain->num_impl++;
     return 0;
@@ -231,7 +231,7 @@ int ff_sws_op_compile_tables(const SwsOpTable *const 
tables[], int num_tables,
     }
 
     chain->cpu_flags |= best_cpu_flags;
-    ret = ff_sws_op_chain_append(chain, best->func, best->free, priv);
+    ret = ff_sws_op_chain_append(chain, best->func, best->free, &priv);
     if (ret < 0) {
         if (best->free)
             best->free(&priv);
diff --git a/libswscale/ops_chain.h b/libswscale/ops_chain.h
index 777d8e13c1..ceff7e4e7e 100644
--- a/libswscale/ops_chain.h
+++ b/libswscale/ops_chain.h
@@ -90,7 +90,7 @@ void ff_sws_op_chain_free(SwsOpChain *chain);
 
 /* Returns 0 on success, or a negative error code. */
 int ff_sws_op_chain_append(SwsOpChain *chain, SwsFuncPtr func,
-                           void (*free)(void *), SwsOpPriv priv);
+                           void (*free)(void *), const SwsOpPriv *priv);
 
 typedef struct SwsOpEntry {
     /* Kernel metadata; reduced size subset of SwsOp */
diff --git a/libswscale/x86/ops.c b/libswscale/x86/ops.c
index b3fe5fb014..8704f77227 100644
--- a/libswscale/x86/ops.c
+++ b/libswscale/x86/ops.c
@@ -695,7 +695,7 @@ static int compile(SwsContext *ctx, SwsOpList *ops, 
SwsCompiledOp *out)
         SWS_DECL_FUNC(NAME);                                    \
         void NAME##_return(void);                               \
         ret = ff_sws_op_chain_append(chain, NAME##_return,      \
-                                     NULL, (SwsOpPriv) {0});    \
+                                     NULL, &(SwsOpPriv) {0});   \
         out->func = NAME;                                       \
     } while (0)
 

-----------------------------------------------------------------------

Summary of changes:
 libswscale/ops_chain.c | 6 +++---
 libswscale/ops_chain.h | 2 +-
 libswscale/x86/ops.c   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)


hooks/post-receive
-- 

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

Reply via email to