diff options
author | William Yu <genwillyu@gmail.com> | 2011-08-11 15:47:33 +0200 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-08-11 16:09:20 +0200 |
commit | 30ea0e47b5ddb13b431f997655b567d738e86d23 (patch) | |
tree | 985a6d5a79a942c01d492877392a26585963eb0e /libavfilter/vf_select.c | |
parent | 43fab7aafc3efc3d88e23a1ba27b939be09b3bd3 (diff) | |
download | ffmpeg-30ea0e47b5ddb13b431f997655b567d738e86d23.tar.gz |
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>
Diffstat (limited to 'libavfilter/vf_select.c')
-rw-r--r-- | libavfilter/vf_select.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavfilter/vf_select.c b/libavfilter/vf_select.c index 3cd2347fa4..33269b6594 100644 --- a/libavfilter/vf_select.c +++ b/libavfilter/vf_select.c @@ -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 = { |