1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avutil/log: Set AVClass* in av_expr_eval()

Otherwise it is possible for av_log() to receive a non-NULL object
with a NULL AVClass pointer; the default log callback handles it
gracefully, yet this is probably an API violation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-03-05 03:14:16 +01:00
parent 39286d97f2
commit f641c6846a

View File

@ -791,12 +791,14 @@ int av_expr_count_func(AVExpr *e, unsigned *counter, int size, int arg)
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque) double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
{ {
Parser p = { 0 }; Parser p = {
p.var= e->var; .class = &eval_class,
p.prng_state= e->prng_state; .const_values = const_values,
.opaque = opaque,
.var = e->var,
.prng_state = e->prng_state,
};
p.const_values = const_values;
p.opaque = opaque;
return eval_expr(&p, e); return eval_expr(&p, e);
} }