aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-09-20 10:29:54 -0300
committerJames Almer <jamrial@gmail.com>2024-09-23 09:02:23 -0300
commita48eba0021a95282facb34049a363e0d0636f373 (patch)
tree79c00382e07d3d2654a38afd864853782bae05cd
parentaeb64d6fa5b65536e1a888a8a6a93ebc4dece504 (diff)
downloadffmpeg-a48eba0021a95282facb34049a363e0d0636f373.tar.gz
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>
-rw-r--r--fftools/ffmpeg_filter.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 8b420e68ab..529e631781 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -1444,11 +1444,15 @@ static int insert_filter(AVFilterContext **last_filter, int *pad_idx,
const char *filter_name, const char *args)
{
AVFilterGraph *graph = (*last_filter)->graph;
+ const AVFilter *filter = avfilter_get_by_name(filter_name);
AVFilterContext *ctx;
int ret;
+ if (!filter)
+ return AVERROR_BUG;
+
ret = avfilter_graph_create_filter(&ctx,
- avfilter_get_by_name(filter_name),
+ filter,
filter_name, args, NULL, graph);
if (ret < 0)
return ret;