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)