avfilter/crop: avoid premature eval error
authorGyan Doshi <ffmpeg@gyani.pro>
Wed, 4 Dec 2019 10:33:11 +0000 (16:03 +0530)
committerGyan Doshi <ffmpeg@gyani.pro>
Fri, 6 Dec 2019 04:49:47 +0000 (10:19 +0530)
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.

libavfilter/vf_crop.c

index d6b4feb..9bf4077 100644 (file)
@@ -174,10 +174,9 @@ static int config_input(AVFilterLink *link)
         s->vsub = pix_desc->log2_chroma_h;
     }
 
-    if ((ret = av_expr_parse_and_eval(&res, (expr = s->w_expr),
-                                      var_names, s->var_values,
-                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
-        goto fail_expr;
+    av_expr_parse_and_eval(&res, (expr = s->w_expr),
+                           var_names, s->var_values,
+                           NULL, NULL, NULL, NULL, NULL, 0, ctx);
     s->var_values[VAR_OUT_W] = s->var_values[VAR_OW] = res;
     if ((ret = av_expr_parse_and_eval(&res, (expr = s->h_expr),
                                       var_names, s->var_values,