diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 1202146607..50f0edd332 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -3275,9 +3275,8 @@ static int opt_audio_qscale(void *optctx, const char *opt, const char *arg) static int opt_filter_complex(void *optctx, const char *opt, const char *arg) { - FilterGraph *fg; - ALLOC_ARRAY_ELEM(filtergraphs, nb_filtergraphs); - fg = filtergraphs[nb_filtergraphs - 1]; + FilterGraph *fg = ALLOC_ARRAY_ELEM(filtergraphs, nb_filtergraphs); + fg->index = nb_filtergraphs - 1; fg->graph_desc = av_strdup(arg); if (!fg->graph_desc)