diff options
author | Clément Bœsch <ubitux@gmail.com> | 2013-03-31 10:00:32 +0200 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2013-03-31 10:00:32 +0200 |
commit | 29667a2c2014a54cf05f8106c45ad78be5228fd0 (patch) | |
tree | 66260c376c8dfd680a54b18156d31d031d744ff2 | |
parent | 8cd7aab1bb29ac28c13a44a37546d93d91ac7814 (diff) | |
download | ffmpeg-29667a2c2014a54cf05f8106c45ad78be5228fd0.tar.gz |
decimate: check for avctx ptr before closing.
Fixes a crash init failed before setting avctx.
-rw-r--r-- | libavfilter/vf_decimate.c | 6 |
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) |