Commit b66a8008 authored by Gyan Doshi's avatar Gyan Doshi

avfilter/crop: avoid premature eval error

Width and height expressions can refer to each other. Width is
evaluated twice to allow for reference to output height. So we
should not error out upon failure of first evaluation of width.
parent 71fd7207
...@@ -174,10 +174,9 @@ static int config_input(AVFilterLink *link) ...@@ -174,10 +174,9 @@ static int config_input(AVFilterLink *link)
s->vsub = pix_desc->log2_chroma_h; s->vsub = pix_desc->log2_chroma_h;
} }
if ((ret = av_expr_parse_and_eval(&res, (expr = s->w_expr), av_expr_parse_and_eval(&res, (expr = s->w_expr),
var_names, s->var_values, var_names, s->var_values,
NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) NULL, NULL, NULL, NULL, NULL, 0, ctx);
goto fail_expr;
s->var_values[VAR_OUT_W] = s->var_values[VAR_OW] = res; s->var_values[VAR_OUT_W] = s->var_values[VAR_OW] = res;
if ((ret = av_expr_parse_and_eval(&res, (expr = s->h_expr), if ((ret = av_expr_parse_and_eval(&res, (expr = s->h_expr),
var_names, s->var_values, var_names, s->var_values,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment