diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c index 2a8a017990..ea2270f935 100644 --- a/libavfilter/graphparser.c +++ b/libavfilter/graphparser.c @@ -218,7 +218,6 @@ static int link_filter_inouts(AVFilterContext *filter, while(pad--) { AVFilterInOut *p = *currInputs; - *currInputs = (*currInputs)->next; if(!p) { av_log(log_ctx, AV_LOG_ERROR, "Not enough inputs specified for the \"%s\" filter.\n", @@ -226,6 +225,8 @@ static int link_filter_inouts(AVFilterContext *filter, return -1; } + *currInputs = (*currInputs)->next; + if(p->filter) { if(link_filter(p->filter, p->pad_idx, filter, pad, log_ctx)) return -1;