@@ -127,6 +204,22 @@ static av_cold int init_dict(AVFilterContext
*ctx, AVDictionary **opts)
if (!scale->h_expr)
av_opt_set(scale, "h", "ih", 0);
+ ret = av_expr_parse(&scale->w_pexpr, scale->w_expr,
+ names,
+ NULL, NULL, NULL, NULL, 0, ctx);
+ if (ret < 0) {
+ av_log(ctx, AV_LOG_ERROR, "Cannot parse width expression:
'%s'\n", scale->w_expr);
+ return ret;
+ }
+
+ ret = av_expr_parse(&scale->h_pexpr, scale->h_expr,
+ names,
+ NULL, NULL, NULL, NULL, 0, ctx);
+ if (ret < 0) {
+ av_log(ctx, AV_LOG_ERROR, "Cannot parse height expression:
'%s'\n", scale->h_expr);
+ return ret;
+ }
+
+ if (w) {
+ ret = av_expr_parse(&scale->w_pexpr, scale->w_expr,
+ names,
+ NULL, NULL, NULL, NULL, 0, ctx);
+ if (ret < 0) {
+ av_log(ctx, AV_LOG_ERROR, "Cannot parse width
expression: '%s'\n", scale->w_expr);
+ goto revert;
+ }
+ }
+
+ if (h) {
+ ret = av_expr_parse(&scale->h_pexpr, scale->h_expr,
+ names,
+ NULL, NULL, NULL, NULL, 0, ctx);
+ if (ret < 0) {
+ av_log(ctx, AV_LOG_ERROR, "Cannot parse height
expression: '%s'\n", scale->h_expr);
+ goto revert;
+ }
+ }