avfilter/vf_mcdeint: free the AVCodecContext struct properly
authorJames Almer <jamrial@gmail.com>
Wed, 30 Aug 2017 17:34:04 +0000 (14:34 -0300)
committerJames Almer <jamrial@gmail.com>
Wed, 30 Aug 2017 17:36:01 +0000 (14:36 -0300)
Signed-off-by: James Almer <jamrial@gmail.com>
libavfilter/vf_mcdeint.c

index 26387b8..d53322b 100644 (file)
@@ -154,10 +154,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 {
     MCDeintContext *mcdeint = ctx->priv;
 
-    if (mcdeint->enc_ctx) {
-        avcodec_close(mcdeint->enc_ctx);
-        av_freep(&mcdeint->enc_ctx);
-    }
+    avcodec_free_context(&mcdeint->enc_ctx);
 }
 
 static int query_formats(AVFilterContext *ctx)