diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2011-11-02 22:08:28 +0100 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2011-11-05 02:13:37 +0100 |
commit | 217790871e7d8f2e9690fbe785d29683e7f9ab23 (patch) | |
tree | a81862213c7ebfdd5e7e1ee5060be2e6c75d7191 | |
parent | 6ace8374bacf33e5f3407cb50e928e7533eb5e92 (diff) | |
download | ffmpeg-217790871e7d8f2e9690fbe785d29683e7f9ab23.tar.gz |
lavfi: issue error if maximum number of filters is reached
Issue an error and return a more meaningful error code in case the
maximum number of registered filters has been reached.
This is better than silently ignore the error, improve feedback.
-rw-r--r-- | libavfilter/avfilter.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index c1b7c43611..d5f0c4b901 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -706,8 +706,13 @@ AVFilter *avfilter_get_by_name(const char *name) int avfilter_register(AVFilter *filter) { - if (next_registered_avfilter_idx == MAX_REGISTERED_AVFILTERS_NB) - return -1; + if (next_registered_avfilter_idx == MAX_REGISTERED_AVFILTERS_NB) { + av_log(NULL, AV_LOG_ERROR, + "Maximum number of registered filters %d reached, " + "impossible to register filter with name '%s'\n", + MAX_REGISTERED_AVFILTERS_NB, filter->name); + return AVERROR(ENOMEM); + } registered_avfilters[next_registered_avfilter_idx++] = filter; return 0; |