mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-26 17:32:06 +00:00
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).
This commit is contained in:
parent
d0a24bfad1
commit
6317d40d08
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user