From f6dd145533eebdde189adafc791236b2e5419287 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 28 Nov 2012 14:46:46 +0100 Subject: [PATCH] avfilter: check that filter_frame and slice variants are not both used Signed-off-by: Michael Niedermayer --- libavfilter/avfilter.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index c7384db4b1..d1b6d05a38 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -409,6 +409,8 @@ AVFilter *avfilter_get_by_name(const char *name) int avfilter_register(AVFilter *filter) { + int i; + if (next_registered_avfilter_idx == MAX_REGISTERED_AVFILTERS_NB) { av_log(NULL, AV_LOG_ERROR, "Maximum number of registered filters %d reached, " @@ -417,6 +419,12 @@ int avfilter_register(AVFilter *filter) return AVERROR(ENOMEM); } + for(i=0; filter->inputs && filter->inputs[i].name; i++) { + const AVFilterPad *input = &filter->inputs[i]; + av_assert0( !input->filter_frame + || (!input->start_frame && !input->end_frame && !input->draw_slice)); + } + registered_avfilters[next_registered_avfilter_idx++] = filter; return 0; }