Browse Source

vf_select: add NULL-checks in uninit

Fix NULL pointer dereference in case of failed initialization.

Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
tags/n0.9
William Yu Stefano Sabatini 13 years ago
parent
commit
30ea0e47b5
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavfilter/vf_select.c

+ 4
- 0
libavfilter/vf_select.c View File

@@ -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 = {


Loading…
Cancel
Save