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

lavfi/select: make sure avctx is set before closing it.

This avoid a crash when the filter fails before config_input(),
typically with a syntax error in the next filter:
    select=gt(scene\,.4),select=fail
parent 9e208ce6
...@@ -383,8 +383,10 @@ static av_cold void uninit(AVFilterContext *ctx) ...@@ -383,8 +383,10 @@ static av_cold void uninit(AVFilterContext *ctx)
if (select->do_scene_detect) { if (select->do_scene_detect) {
avfilter_unref_bufferp(&select->prev_picref); avfilter_unref_bufferp(&select->prev_picref);
avcodec_close(select->avctx); if (select->avctx) {
av_freep(&select->avctx); avcodec_close(select->avctx);
av_freep(&select->avctx);
}
} }
} }
......
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