summaryrefslogtreecommitdiff
path: root/libavfilter/vf_select.c
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2012-09-18 18:49:09 +0200
committerClément Bœsch <ubitux@gmail.com>2012-09-18 18:52:57 +0200
commitb89c16e73eef30b7ce95bd455d9b419b383d9409 (patch)
treeaa53441e5736d6d20ce44b9791feb743ccd4c386 /libavfilter/vf_select.c
parent9e208ce6dd94596b4185a93af4aab3dcd28eb5b7 (diff)
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
Diffstat (limited to 'libavfilter/vf_select.c')
-rw-r--r--libavfilter/vf_select.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/vf_select.c b/libavfilter/vf_select.c
index d47876bbba..72af50e646 100644
--- a/libavfilter/vf_select.c
+++ b/libavfilter/vf_select.c
@@ -383,8 +383,10 @@ static av_cold void uninit(AVFilterContext *ctx)
if (select->do_scene_detect) {
avfilter_unref_bufferp(&select->prev_picref);
- avcodec_close(select->avctx);
- av_freep(&select->avctx);
+ if (select->avctx) {
+ avcodec_close(select->avctx);
+ av_freep(&select->avctx);
+ }
}
}