Commit 21779087 authored by Stefano Sabatini's avatar Stefano Sabatini

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.
parent 6ace8374
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment