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

Git pushed a commit to branch master
in repository ffmpeg.

commit e07daf85a40d84c8c3a021f4db577f5fd6090390
Author:     Martin Storsjö <[email protected]>
AuthorDate: Sun Mar 15 15:56:35 2026 +0200
Commit:     Martin Storsjö <[email protected]>
CommitDate: Mon Mar 16 20:31:12 2026 +0000

    swscale/ops_chain: Don't pass an aligned union as parameter by value
    
    Passing a struct/union by value can generally be inefficient.
    Additionally, when the struct/union is declared to be aligned,
    whether it really stays aligned when passed as a parameter by
    value is unclear.
    
    This fixes build errors like this, with MSVC targeting 32 bit ARM:
    
        libswscale/ops_chain.h(91): error C2719: 'unnamed-parameter': formal 
parameter with requested alignment of 16 won't be aligned
---
 libswscale/ops_chain.c |  6 +++---
 libswscale/ops_chain.h | 10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/libswscale/ops_chain.c b/libswscale/ops_chain.c
index 1a4ac539ba..c58cb9c8ea 100644
--- a/libswscale/ops_chain.c
+++ b/libswscale/ops_chain.c
@@ -39,14 +39,14 @@ void ff_sws_op_chain_free_cb(void *ptr)
     SwsOpChain *chain = ptr;
     for (int i = 0; i < chain->num_impl + 1; i++) {
         if (chain->free[i])
-            chain->free[i](chain->impl[i].priv);
+            chain->free[i](&chain->impl[i].priv);
     }
 
     av_free(chain);
 }
 
 int ff_sws_op_chain_append(SwsOpChain *chain, SwsFuncPtr func,
-                           void (*free)(SwsOpPriv), const SwsOpPriv *priv)
+                           void (*free)(SwsOpPriv *), const SwsOpPriv *priv)
 {
     const int idx = chain->num_impl;
     if (idx == SWS_MAX_OPS)
@@ -235,7 +235,7 @@ int ff_sws_op_compile_tables(const SwsOpTable *const 
tables[], int num_tables,
     ret = ff_sws_op_chain_append(chain, best->func, best->free, &priv);
     if (ret < 0) {
         if (best->free)
-            best->free(priv);
+            best->free(&priv);
         return ret;
     }
 
diff --git a/libswscale/ops_chain.h b/libswscale/ops_chain.h
index 76ab5d964b..9009936f91 100644
--- a/libswscale/ops_chain.h
+++ b/libswscale/ops_chain.h
@@ -88,7 +88,7 @@ static_assert(offsetof(SwsOpImpl, priv) == 16, "SwsOpImpl 
layout mismatch");
 typedef struct SwsOpChain {
 #define SWS_MAX_OPS 16
     SwsOpImpl impl[SWS_MAX_OPS + 1]; /* reserve extra space for the entrypoint 
*/
-    void (*free[SWS_MAX_OPS + 1])(SwsOpPriv);
+    void (*free[SWS_MAX_OPS + 1])(SwsOpPriv *);
     int num_impl;
     int cpu_flags; /* set of all used CPU flags */
 } SwsOpChain;
@@ -102,7 +102,7 @@ static inline 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)(SwsOpPriv), const SwsOpPriv *priv);
+                           void (*free)(SwsOpPriv *), const SwsOpPriv *priv);
 
 typedef struct SwsOpEntry {
     /* Kernel metadata; reduced size subset of SwsOp */
@@ -125,12 +125,12 @@ typedef struct SwsOpEntry {
     /* Kernel implementation */
     SwsFuncPtr func;
     int (*setup)(const SwsOp *op, SwsOpPriv *out); /* optional */
-    void (*free)(SwsOpPriv priv);
+    void (*free)(SwsOpPriv *priv);
 } SwsOpEntry;
 
-static inline void ff_op_priv_free(SwsOpPriv priv)
+static inline void ff_op_priv_free(SwsOpPriv *priv)
 {
-    av_free(priv.ptr);
+    av_free(priv->ptr);
 }
 
 typedef struct SwsOpTable {

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

Reply via email to