X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Favfilter.c;h=5327cf9b69c2f14fbe782c73e6b8ed24d246df98;hb=dd1fb6528791b32ac9d6b3c2d81707cf1949ec5d;hp=c1b7c436118e8cb16480df4c64f88c2a951c3600;hpb=259a960f1b74339626f8da890cc261a4043097fe;p=ffmpeg diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index c1b7c436118..5327cf9b69c 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -473,7 +473,7 @@ AVFilterBufferRef *avfilter_get_audio_buffer(AVFilterLink *link, AVFilterBufferRef * avfilter_get_audio_buffer_ref_from_arrays(uint8_t *data[8], int linesize[8], int perms, int nb_samples, enum AVSampleFormat sample_fmt, - int64_t channel_layout, int planar) + uint64_t channel_layout, int planar) { AVFilterBuffer *samples = av_mallocz(sizeof(AVFilterBuffer)); AVFilterBufferRef *samplesref = av_mallocz(sizeof(AVFilterBufferRef)); @@ -687,7 +687,7 @@ void avfilter_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) filter_samples(link, link->cur_buf); } -#define MAX_REGISTERED_AVFILTERS_NB 64 +#define MAX_REGISTERED_AVFILTERS_NB 128 static AVFilter *registered_avfilters[MAX_REGISTERED_AVFILTERS_NB + 1]; @@ -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;