diff --git a/libavfilter/vf_ass.c b/libavfilter/vf_ass.c index 3f0d3a994c..ade1b37374 100644 --- a/libavfilter/vf_ass.c +++ b/libavfilter/vf_ass.c @@ -332,10 +332,10 @@ static av_cold int init_subtitles(AVFilterContext *ctx, const char *args) } end: - if (fmt) - avformat_close_input(&fmt); if (dec_ctx) avcodec_close(dec_ctx); + if (fmt) + avformat_close_input(&fmt); return ret; }