summaryrefslogtreecommitdiff
path: root/libavfilter/vf_decimate.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavfilter/vf_decimate.c')
-rw-r--r--libavfilter/vf_decimate.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/vf_decimate.c b/libavfilter/vf_decimate.c
index 630f3ba492..2410344176 100644
--- a/libavfilter/vf_decimate.c
+++ b/libavfilter/vf_decimate.c
@@ -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)