summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-03-31 10:00:32 +0200
committerClément Bœsch <ubitux@gmail.com>2013-03-31 10:00:32 +0200
commit29667a2c2014a54cf05f8106c45ad78be5228fd0 (patch)
tree66260c376c8dfd680a54b18156d31d031d744ff2 /libavfilter
parent8cd7aab1bb29ac28c13a44a37546d93d91ac7814 (diff)
decimate: check for avctx ptr before closing.
Fixes a crash init failed before setting avctx.
Diffstat (limited to 'libavfilter')
-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)