aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/avfilter.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2021-02-05 12:23:57 +0100
committerPaul B Mahol <onemda@gmail.com>2021-02-06 11:40:59 +0100
commit6317d40d0813fa1e251730052de87fafb909b829 (patch)
tree146a63f4a8e957e203c486a1bb3b2004814800dc /libavfilter/avfilter.c
parentd0a24bfad17ffc8ce41ac323e5460641ba6dec29 (diff)
downloadffmpeg-6317d40d0813fa1e251730052de87fafb909b829.tar.gz
avfilter/avfilter: move enable_str expression parsing into avfilter_init_dict()
This ensures that needed arrays are always allocated and properly initialized. Previously if code would use only avfilter_init_dict() to set options for filters it would not allocate arrays for timeline processing thus it would crash if user supplied enable option for filter(s).
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r--libavfilter/avfilter.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 4c52d83842..d560655f42 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -875,11 +875,6 @@ static int process_options(AVFilterContext *ctx, AVDictionary **options,
count++;
}
- if (ctx->enable_str) {
- ret = set_enable_expr(ctx, ctx->enable_str);
- if (ret < 0)
- return ret;
- }
return count;
}
@@ -930,6 +925,12 @@ int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options)
else if (ctx->filter->init_dict)
ret = ctx->filter->init_dict(ctx, options);
+ if (ctx->enable_str) {
+ ret = set_enable_expr(ctx, ctx->enable_str);
+ if (ret < 0)
+ return ret;
+ }
+
return ret;
}