decimate: check for avctx ptr before closing.
authorClément Bœsch <ubitux@gmail.com>
Sun, 31 Mar 2013 08:00:32 +0000 (10:00 +0200)
committerClément Bœsch <ubitux@gmail.com>
Sun, 31 Mar 2013 08:00:32 +0000 (10:00 +0200)
Fixes a crash init failed before setting avctx.

libavfilter/vf_decimate.c

index 630f3ba..2410344 100644 (file)
@@ -148,8 +148,10 @@ static av_cold void uninit(AVFilterContext *ctx)
 {
     DecimateContext *decimate = ctx->priv;
     av_frame_free(&decimate->ref);
-    avcodec_close(decimate->avctx);
-    av_freep(&decimate->avctx);
+    if (decimate->avctx) {
+        avcodec_close(decimate->avctx);
+        av_freep(&decimate->avctx);
+    }
 }
 
 static int query_formats(AVFilterContext *ctx)