diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 3805912828..963f5e6479 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -227,6 +227,11 @@ int avfilter_config_links(AVFilterContext *filter) AVFilterLink *inlink; if (!link) continue; + if (!link->src || !link->dst) { + av_log(filter, AV_LOG_ERROR, + "Not all input and output are properly linked (%d).\n", i); + return AVERROR(EINVAL); + } inlink = link->src->nb_inputs ? link->src->inputs[0] : NULL; link->current_pts = AV_NOPTS_VALUE;