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). Signed-off-by: Paul B Mahol <one...@gmail.com> --- libavfilter/avfilter.c | 11 ++++++----- 1 file 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; } -- 2.17.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".