提交 30ea0e47 编写于 作者: W William Yu 提交者: Stefano Sabatini

vf_select: add NULL-checks in uninit

Fix NULL pointer dereference in case of failed initialization.
Signed-off-by: NStefano Sabatini <stefano.sabatini-lala@poste.it>
上级 43fab7aa
......@@ -319,14 +319,18 @@ static av_cold void uninit(AVFilterContext *ctx)
AVFilterBufferRef *picref;
int i;
if (select->expr)
av_expr_free(select->expr);
select->expr = NULL;
if (select->pending_frames) {
for (i = 0; i < av_fifo_size(select->pending_frames)/sizeof(picref); i++) {
av_fifo_generic_read(select->pending_frames, &picref, sizeof(picref), NULL);
avfilter_unref_buffer(picref);
}
av_fifo_free(select->pending_frames);
}
select->pending_frames = NULL;
}
AVFilter avfilter_vf_select = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册