mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-14 03:11:20 +00:00
fftools/ffmpeg_filter: ensure that the inserted filters exist
If not, report it as a bug. avfilter_graph_create_filter() will return ENOMEM if the passed filter argument is NULL, which is misleading. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
aeb64d6fa5
commit
a48eba0021
@ -1444,11 +1444,15 @@ static int insert_filter(AVFilterContext **last_filter, int *pad_idx,
|
|||||||
const char *filter_name, const char *args)
|
const char *filter_name, const char *args)
|
||||||
{
|
{
|
||||||
AVFilterGraph *graph = (*last_filter)->graph;
|
AVFilterGraph *graph = (*last_filter)->graph;
|
||||||
|
const AVFilter *filter = avfilter_get_by_name(filter_name);
|
||||||
AVFilterContext *ctx;
|
AVFilterContext *ctx;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (!filter)
|
||||||
|
return AVERROR_BUG;
|
||||||
|
|
||||||
ret = avfilter_graph_create_filter(&ctx,
|
ret = avfilter_graph_create_filter(&ctx,
|
||||||
avfilter_get_by_name(filter_name),
|
filter,
|
||||||
filter_name, args, NULL, graph);
|
filter_name, args, NULL, graph);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user