diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-04-25 00:25:18 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-04-27 21:38:13 +0200 |
commit | 6b55aab01a5c2e4c9f2851fdb9b7583f184b5241 (patch) | |
tree | f7003f2883ea88506de887a9304ba633f9160dcc /libavfilter/vf_blackdetect.c | |
parent | 6f3b1d7f8643932a4ffc582cc77d8c5fe81b904d (diff) | |
download | ffmpeg-streaming-6b55aab01a5c2e4c9f2851fdb9b7583f184b5241.zip ffmpeg-streaming-6b55aab01a5c2e4c9f2851fdb9b7583f184b5241.tar.gz |
lavfi: create buffer reference in filters which need to access the ref later
Also add internal function ff_null_start_frame_keep_ref().
Fix crash when a following filter (e.g. settb) will unref the reference
passed by start_frame(), and then the reference is accessed in
end_frame() through inlink->cur_buf.
Diffstat (limited to 'libavfilter/vf_blackdetect.c')
-rw-r--r-- | libavfilter/vf_blackdetect.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/vf_blackdetect.c b/libavfilter/vf_blackdetect.c index db94794..ea45f05 100644 --- a/libavfilter/vf_blackdetect.c +++ b/libavfilter/vf_blackdetect.c @@ -180,6 +180,7 @@ static void end_frame(AVFilterLink *inlink) blackdetect->frame_count++; blackdetect->nb_black_pixels = 0; + avfilter_unref_buffer(picref); avfilter_end_frame(inlink->dst->outputs[0]); } @@ -196,7 +197,7 @@ AVFilter avfilter_vf_blackdetect = { .config_props = config_input, .draw_slice = draw_slice, .get_video_buffer = avfilter_null_get_video_buffer, - .start_frame = avfilter_null_start_frame, + .start_frame = ff_null_start_frame_keep_ref, .end_frame = end_frame, }, { .name = NULL } }, |