Commit 29667a2c authored by Clément Bœsch's avatar Clément Bœsch

decimate: check for avctx ptr before closing.

Fixes a crash init failed before setting avctx.
parent 8cd7aab1
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment