diff options
author | Paul B Mahol <onemda@gmail.com> | 2015-04-03 17:55:18 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2015-04-08 13:05:06 +0000 |
commit | a0854c084ea1541591c54aaab1f993ebaf92ffaf (patch) | |
tree | 1ebc69023a4f7eb471ce60ff4784b146a8b9973f /libavfilter | |
parent | 21e034a47a2b407f0896114a995fd507f0f5230f (diff) | |
download | ffmpeg-streaming-a0854c084ea1541591c54aaab1f993ebaf92ffaf.zip ffmpeg-streaming-a0854c084ea1541591c54aaab1f993ebaf92ffaf.tar.gz |
avfilter: handle error in query_formats() in bunch of filters
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter')
81 files changed, 401 insertions, 234 deletions
diff --git a/libavfilter/aeval.c b/libavfilter/aeval.c index 69de1f7..b6c420a 100644 --- a/libavfilter/aeval.c +++ b/libavfilter/aeval.c @@ -247,12 +247,28 @@ static int query_formats(AVFilterContext *ctx) static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }; int64_t chlayouts[] = { eval->chlayout ? eval->chlayout : FF_COUNT2LAYOUT(eval->nb_channels) , -1 }; int sample_rates[] = { eval->sample_rate, -1 }; + AVFilterFormats *formats; + AVFilterChannelLayouts *layouts; + int ret; + + formats = ff_make_format_list(sample_fmts); + if (!formats) + return AVERROR(ENOMEM); + ret = ff_set_common_formats (ctx, formats); + if (ret < 0) + return ret; - ff_set_common_formats (ctx, ff_make_format_list(sample_fmts)); - ff_set_common_channel_layouts(ctx, avfilter_make_format64_list(chlayouts)); - ff_set_common_samplerates(ctx, ff_make_format_list(sample_rates)); + layouts = avfilter_make_format64_list(chlayouts); + if (!layouts) + return AVERROR(ENOMEM); + ret = ff_set_common_channel_layouts(ctx, layouts); + if (ret < 0) + return ret; - return 0; + formats = ff_make_format_list(sample_rates); + if (!formats) + return AVERROR(ENOMEM); + return ff_set_common_samplerates(ctx, formats); } static int request_frame(AVFilterLink *outlink) diff --git a/libavfilter/af_adelay.c b/libavfilter/af_adelay.c index ef60f43..ca141ce 100644 --- a/libavfilter/af_adelay.c +++ b/libavfilter/af_adelay.c @@ -64,23 +64,26 @@ static int query_formats(AVFilterContext *ctx) AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }; + int ret; layouts = ff_all_channel_layouts(); if (!layouts) return AVERROR(ENOMEM); - ff_set_common_channel_layouts(ctx, layouts); + ret = ff_set_common_channel_layouts(ctx, layouts); + if (ret < 0) + return ret; formats = ff_make_format_list(sample_fmts); if (!formats) return AVERROR(ENOMEM); - ff_set_common_formats(ctx, formats); + ret = ff_set_common_formats(ctx, formats); + if (ret < 0) + return ret; formats = ff_all_samplerates(); if (!formats) return AVERROR(ENOMEM); - ff_set_common_samplerates(ctx, formats); - - return 0; + return ff_set_common_samplerates(ctx, formats); } #define DELAY(name, type, fill) \ diff --git a/libavfilter/af_aecho.c b/libavfilter/af_aecho.c index c26fdd4..8e7a39e 100644 --- a/libavfilter/af_aecho.c +++ b/libavfilter/af_aecho.c @@ -158,23 +158,26 @@ static int query_formats(AVFilterContext *ctx) AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }; + int ret; layouts = ff_all_channel_layouts(); if (!layouts) return AVERROR(ENOMEM); - ff_set_common_channel_layouts(ctx, layouts); + ret = ff_set_common_channel_layouts(ctx, layouts); + if (ret < 0) + return ret; formats = ff_make_format_list(sample_fmts); if (!formats) return AVERROR(ENOMEM); - ff_set_common_formats(ctx, formats); + ret = ff_set_common_formats(ctx, formats); + if (ret < 0) + return ret; formats = ff_all_samplerates(); if (!formats) return AVERROR(ENOMEM); - ff_set_common_samplerates(ctx, formats); - - return 0; + return ff_set_common_samplerates(ctx, formats); } #define MOD(a, b) (((a) >= (b)) ? (a) - (b) : (a)) diff --git a/libavfilter/af_afade.c b/libavfilter/af_afade.c index 806f6f6..8b69cef 100644 --- a/libavfilter/af_afade.c +++ b/libavfilter/af_afade.c @@ -98,23 +98,26 @@ static int query_formats(AVFilterContext *ctx) AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }; + int ret; layouts = ff_all_channel_layouts(); if (!layouts) return AVERROR(ENOMEM); - ff_set_common_channel_layouts(ctx, layouts); + ret = ff_set_common_channel_layouts(ctx, layouts); + if (ret < 0) + return ret; formats = ff_make_format_list(sample_fmts); if (!formats) return AVERROR(ENOMEM); - ff_set_common_formats(ctx, formats); + ret = ff_set_common_formats(ctx, formats); + if (ret < 0) + return ret; formats = ff_all_samplerates(); if (!formats) return AVERROR(ENOMEM); - ff_set_common_samplerates(ctx, formats); - - return 0; + return ff_set_common_samplerates(ctx, formats); } static double fade_gain(int curve, int64_t index, int range) diff --git a/libavfilter/af_aformat.c b/libavfilter/af_aformat.c index 5fd0308..4fdcb09 100644 --- a/libavfilter/af_aformat.c +++ b/libavfilter/af_aformat.c @@ -108,15 +108,18 @@ static av_cold int init(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { AFormatContext *s = ctx->priv; + int ret; - ff_set_common_formats(ctx, s->formats ? s->formats : + ret = ff_set_common_formats(ctx, s->formats ? s->formats : ff_all_formats(AVMEDIA_TYPE_AUDIO)); - ff_set_common_samplerates(ctx, s->sample_rates ? s->sample_rates : + if (ret < 0) + return ret; + ret = ff_set_common_samplerates(ctx, s->sample_rates ? s->sample_rates : ff_all_samplerates()); - ff_set_common_channel_layouts(ctx, s->channel_layouts ? s->channel_layouts : + if (ret < 0) + return ret; + return ff_set_common_channel_layouts(ctx, s->channel_layouts ? s->channel_layouts : ff_all_channel_counts()); - - return 0; } static const AVFilterPad avfilter_af_aformat_inputs[] = { diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c index ff9af3d..9a3cbd4 100644 --- a/libavfilter/af_amix.c +++ b/libavfilter/af_amix.c @@ -534,6 +534,7 @@ static int query_formats(AVFilterContext *ctx) { AVFilterFormats *formats = NULL; AVFilterChannelLayouts *layouts; + int ret; layouts = ff_all_channel_layouts(); @@ -542,10 +543,13 @@ static int query_formats(AVFilterContext *ctx) ff_add_format(&formats, AV_SAMPLE_FMT_FLT); ff_add_format(&formats, AV_SAMPLE_FMT_FLTP); - ff_set_common_formats(ctx, formats); - ff_set_common_channel_layouts(ctx, layouts); - ff_set_common_samplerates(ctx, ff_all_samplerates()); - return 0; + ret = ff_set_common_formats(ctx, formats); + if (ret < 0) + return ret; + ret = ff_set_common_channel_layouts(ctx, layouts); + if (ret < 0) + return ret; + return ff_set_common_samplerates(ctx, ff_all_samplerates()); } static const AVFilterPad avfilter_af_amix_outputs[] = { diff --git a/libavfilter/af_aphaser.c b/libavfilter/af_aphaser.c index 708b568..b08570f 100644 --- a/libavfilter/af_aphaser.c +++ b/libavfilter/af_aphaser.c @@ -94,23 +94,26 @@ static int query_formats(AVFilterContext *ctx) AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }; + int ret; layouts = ff_all_channel_layouts(); if (!layouts) return AVERROR(ENOMEM); - ff_set_common_channel_layouts(ctx, layouts); + ret = ff_set_common_channel_layouts(ctx, layouts); + if (ret < 0) + return ret; formats = ff_make_format_list(sample_fmts); if (!formats) return AVERROR(ENOMEM); - ff_set_common_formats(ctx, formats); + ret = ff_set_common_formats(ctx, formats); + if (ret < 0) + return ret; formats = ff_all_samplerates(); if (!formats) return AVERROR(ENOMEM); - ff_set_common_samplerates(ctx, formats); - - return 0; + return ff_set_common_samplerates(ctx, formats); } #define MOD(a, b) (((a) >= (b)) ? (a) - (b) : (a)) diff --git a/libavfilter/af_asetrate.c b/libavfilter/af_asetrate.c index 0d06915..409c48f 100644 --- a/libavfilter/af_asetrate.c +++ b/libavfilter/af_asetrate.c @@ -51,9 +51,8 @@ static av_cold int query_formats(AVFilterContext *ctx) ASetRateContext *sr = ctx->priv; int sample_rates[] = { sr->sample_rate, -1 }; - ff_formats_ref(ff_make_format_list(sample_rates), + return ff_formats_ref(ff_make_format_list(sample_rates), &ctx->outputs[0]->in_samplerates); - return 0; } static av_cold int config_props(AVFilterLink *outlink) diff --git a/libavfilter/af_astats.c b/libavfilter/af_astats.c index c20f84d..5780fb9 100644 --- a/libavfilter/af_astats.c +++ b/libavfilter/af_astats.c @@ -64,23 +64,26 @@ static int query_formats(AVFilterContext *ctx) AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }; + int ret; layouts = ff_all_channel_layouts(); if (!layouts) return AVERROR(ENOMEM); - ff_set_common_channel_layouts(ctx, layouts); + ret = ff_set_common_channel_layouts(ctx, layouts); + if (ret < 0) + return ret; formats = ff_make_format_list(sample_fmts); if (!formats) return AVERROR(ENOMEM); - ff_set_common_formats(ctx, formats); + ret = ff_set_common_formats(ctx, formats); + if (ret < 0) + return ret; formats = ff_all_samplerates(); if (!formats) return AVERROR(ENOMEM); - ff_set_common_samplerates(ctx, formats); - - return 0; + return ff_set_common_samplerates(ctx, formats); } static int config_output(AVFilterLink *outlink) diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c index fcd0cb0..49d49ee 100644 --- a/libavfilter/af_atempo.c +++ b/libavfilter/af_atempo.c @@ -1012,26 +1012,29 @@ static int query_formats(AVFilterContext *ctx) AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_NONE }; + int ret; layouts = ff_all_channel_layouts(); if (!layouts) { return AVERROR(ENOMEM); } - ff_set_common_channel_layouts(ctx, layouts); + ret = ff_set_common_channel_layouts(ctx, layouts); + if (ret < 0) + return ret; formats = ff_make_format_list(sample_fmts); if (!formats) { return AVERROR(ENOMEM); } - ff_set_common_formats(ctx, formats); + ret = ff_set_common_formats(ctx, formats); + if (ret < 0) + return ret; formats = ff_all_samplerates(); if (!formats) { return AVERROR(ENOMEM); } - ff_set_common_samplerates(ctx, formats); - - return 0; + return ff_set_common_samplerates(ctx, formats); } static int config_props(AVFilterLink *inlink) diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c index 91662c4..118a0c0 100644 --- a/libavfilter/af_biquads.c +++ b/libavfilter/af_biquads.c @@ -142,23 +142,26 @@ static int query_formats(AVFilterContext *ctx) AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }; + int ret; layouts = ff_all_channel_layouts(); if (!layouts) return AVERROR(ENOMEM); - ff_set_common_channel_layouts(ctx, layouts); + ret = ff_set_common_channel_layouts(ctx, layouts); + if (ret < 0) + return ret; formats = ff_make_format_list(sample_fmts); if (!formats) return AVERROR(ENOMEM); - ff_set_common_formats(ctx, formats); + ret = ff_set_common_formats(ctx, formats); + if (ret < 0) + return ret; formats = ff_all_samplerates(); if (!formats) return AVERROR(ENOMEM); - ff_set_common_samplerates(ctx, formats); - - return 0; + return ff_set_common_samplerates(ctx, formats); } #define BIQUAD_FILTER(name, type, min, max, need_clipping) \ diff --git a/libavfilter/af_bs2b.c b/libavfilter/af_bs2b.c index 3dd0bcd..592fdec 100644 --- a/libavfilter/af_bs2b.c +++ b/libavfilter/af_bs2b.c @@ -106,22 +106,25 @@ static int query_formats(AVFilterContext *ctx) AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_NONE, }; + int ret; if (ff_add_channel_layout(&layouts, AV_CH_LAYOUT_STEREO) != 0) return AVERROR(ENOMEM); - ff_set_common_channel_layouts(ctx, layouts); + ret = ff_set_common_channel_layouts(ctx, layouts); + if (ret < 0) + return ret; formats = ff_make_format_list(sample_fmts); if (!formats) return AVERROR(ENOMEM); - ff_set_common_formats(ctx, formats); + ret = ff_set_common_formats(ctx, formats); + if (ret < 0) + return ret; formats = ff_all_samplerates(); if (!formats) return AVERROR(ENOMEM); - ff_set_common_samplerates(ctx, formats); - - return 0; + return ff_set_common_samplerates(ctx, formats); } static int filter_frame(AVFilterLink *inlink, AVFrame *frame) diff --git a/libavfilter/af_compand.c b/libavfilter/af_compand.c index 4ca73c4..55ad98a 100644 --- a/libavfilter/af_compand.c +++ b/libavfilter/af_compand.c @@ -107,23 +107,26 @@ static int query_formats(AVFilterContext *ctx) AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }; + int ret; layouts = ff_all_channel_layouts(); if (!layouts) return AVERROR(ENOMEM); - ff_set_common_channel_layouts(ctx, layouts); + ret = ff_set_common_channel_layouts(ctx, layouts); + if (ret < 0) + return ret; formats = ff_make_format_list(sample_fmts); if (!formats) return AVERROR(ENOMEM); - ff_set_common_formats(ctx, formats); + ret = ff_set_common_formats(ctx, formats); + if (ret < 0) + return ret; formats = ff_all_samplerates(); if (!formats) return AVERROR(ENOMEM); - ff_set_common_samplerates(ctx, formats); - - return 0; + return ff_set_common_samplerates(ctx, formats); } static void count_items(char *item_str, int *nb_items) diff --git a/libavfilter/af_dcshift.c b/libavfilter/af_dcshift.c index c1abb3c..eb98156 100644 --- a/libavfilter/af_dcshift.c +++ b/libavfilter/af_dcshift.c @@ -59,23 +59,26 @@ static int query_formats(AVFilterContext *ctx) static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }; + int ret; layouts = ff_all_channel_layouts(); if (!layouts) return AVERROR(ENOMEM); - ff_set_common_channel_layouts(ctx, layouts); + ret = ff_set_common_channel_layouts(ctx, layouts); + if (ret < 0) + return ret; formats = ff_make_format_list(sample_fmts); if (!formats) return AVERROR(ENOMEM); - ff_set_common_formats(ctx, formats); + ret = ff_set_common_formats(ctx, formats); + if (ret < 0) + return ret; formats = ff_all_samplerates(); if (!formats) return AVERROR(ENOMEM); - ff_set_common_samplerates(ctx, formats); - - return 0; + return ff_set_common_samplerates(ctx, formats); } static int filter_frame(AVFilterLink *inlink, AVFrame *in) diff --git a/libavfilter/af_flanger.c b/libavfilter/af_flanger.c index 5ff3786..106e6f7 100644 --- a/libavfilter/af_flanger.c +++ b/libavfilter/af_flanger.c @@ -95,23 +95,26 @@ static int query_formats(AVFilterContext *ctx) static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }; + int ret; layouts = ff_all_channel_layouts(); if (!layouts) return AVERROR(ENOMEM); - ff_set_common_channel_layouts(ctx, layouts); + ret = ff_set_common_channel_layouts(ctx, layouts); + if (ret < 0) + return ret; formats = ff_make_format_list(sample_fmts); if (!formats) return AVERROR(ENOMEM); - ff_set_common_formats(ctx, formats); + ret = ff_set_common_formats(ctx, formats); + if (ret < 0) + return ret; formats = ff_all_samplerates(); if (!formats) return AVERROR(ENOMEM); - ff_set_common_samplerates(ctx, formats); - - return 0; + return ff_set_common_samplerates(ctx, formats); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/af_silencedetect.c b/libavfilter/af_silencedetect.c index 687d2e7..b048d63 100644 --- a/libavfilter/af_silencedetect.c +++ b/libavfilter/af_silencedetect.c @@ -164,23 +164,26 @@ static int query_formats(AVFilterContext *ctx) AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }; + int ret; layouts = ff_all_channel_layouts(); if (!layouts) return AVERROR(ENOMEM); - ff_set_common_channel_layouts(ctx, layouts); + ret = ff_set_common_channel_layouts(ctx, layouts); + if (ret < 0) + return ret; formats = ff_make_format_list(sample_fmts); if (!formats) return AVERROR(ENOMEM); - ff_set_common_formats(ctx, formats); + ret = ff_set_common_formats(ctx, formats); + if (ret < 0) + return ret; formats = ff_all_samplerates(); if (!formats) return AVERROR(ENOMEM); - ff_set_common_samplerates(ctx, formats); - - return 0; + return ff_set_common_samplerates(ctx, formats); } static const AVFilterPad silencedetect_inputs[] = { diff --git a/libavfilter/af_silenceremove.c b/libavfilter/af_silenceremove.c index 02b64ce..cd1e038 100644 --- a/libavfilter/af_silenceremove.c +++ b/libavfilter/af_silenceremove.c @@ -418,23 +418,26 @@ static int query_formats(AVFilterContext *ctx) static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_NONE }; + int ret; layouts = ff_all_channel_layouts(); if (!layouts) return AVERROR(ENOMEM); - ff_set_common_channel_layouts(ctx, layouts); + ret = ff_set_common_channel_layouts(ctx, layouts); + if (ret < 0) + return ret; formats = ff_make_format_list(sample_fmts); if (!formats) return AVERROR(ENOMEM); - ff_set_common_formats(ctx, formats); + ret = ff_set_common_formats(ctx, formats); + if (ret < 0) + return ret; formats = ff_all_samplerates(); if (!formats) return AVERROR(ENOMEM); - ff_set_common_samplerates(ctx, formats); - - return 0; + return ff_set_common_samplerates(ctx, formats); } static av_cold void uninit(AVFilterContext *ctx) diff --git a/libavfilter/af_volume.c b/libavfilter/af_volume.c index 8d49c65..54bffa6 100644 --- a/libavfilter/af_volume.c +++ b/libavfilter/af_volume.c @@ -153,23 +153,26 @@ static int query_formats(AVFilterContext *ctx) AV_SAMPLE_FMT_NONE } }; + int ret; layouts = ff_all_channel_counts(); if (!layouts) return AVERROR(ENOMEM); - ff_set_common_channel_layouts(ctx, layouts); + ret = ff_set_common_channel_layouts(ctx, layouts); + if (ret < 0) + return ret; formats = ff_make_format_list(sample_fmts[vol->precision]); if (!formats) return AVERROR(ENOMEM); - ff_set_common_formats(ctx, formats); + ret = ff_set_common_formats(ctx, formats); + if (ret < 0) + return ret; formats = ff_all_samplerates(); if (!formats) return AVERROR(ENOMEM); - ff_set_common_samplerates(ctx, formats); - - return 0; + return ff_set_common_samplerates(ctx, formats); } static inline void scale_samples_u8(uint8_t *dst, const uint8_t *src, diff --git a/libavfilter/af_volumedetect.c b/libavfilter/af_volumedetect.c index 5de115e..01f24ba 100644 --- a/libavfilter/af_volumedetect.c +++ b/libavfilter/af_volumedetect.c @@ -44,9 +44,7 @@ static int query_formats(AVFilterContext *ctx) if (!(formats = ff_make_format_list(sample_fmts))) return AVERROR(ENOMEM); - ff_set_common_formats(ctx, formats); - - return 0; + return ff_set_common_formats(ctx, formats); } static int filter_frame(AVFilterLink *inlink, AVFrame *samples) diff --git a/libavfilter/asrc_sine.c b/libavfilter/asrc_sine.c index 68e1398..6aa01d5 100644 --- a/libavfilter/asrc_sine.c +++ b/libavfilter/asrc_sine.c @@ -153,11 +153,28 @@ static av_cold int query_formats(AVFilterContext *ctx) int sample_rates[] = { sine->sample_rate, -1 }; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }; + AVFilterFormats *formats; + AVFilterChannelLayouts *layouts; + int ret; - ff_set_common_formats (ctx, ff_make_format_list(sample_fmts)); - ff_set_common_channel_layouts(ctx, avfilter_make_format64_list(chlayouts)); - ff_set_common_samplerates(ctx, ff_make_format_list(sample_rates)); - return 0; + formats = ff_make_format_list(sample_fmts); + if (!formats) + return AVERROR(ENOMEM); + ret = ff_set_common_formats (ctx, formats); + if (ret < 0) + return ret; + + layouts = avfilter_make_format64_list(chlayouts); + if (!layouts) + return AVERROR(ENOMEM); + ret = ff_set_common_channel_layouts(ctx, layouts); + if (ret < 0) + return ret; + + formats = ff_make_format_list(sample_rates); + if (!formats) + return AVERROR(ENOMEM); + return ff_set_common_samplerates(ctx, formats); } static av_cold int config_props(AVFilterLink *outlink) diff --git a/libavfilter/vf_bbox.c b/libavfilter/vf_bbox.c index 1e6feff..e92c3b4 100644 --- a/libavfilter/vf_bbox.c +++ b/libavfilter/vf_bbox.c @@ -56,8 +56,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE, }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } #define SET_META(key, value) \ diff --git a/libavfilter/vf_blackdetect.c b/libavfilter/vf_blackdetect.c index 87a7a23..fbe3d10 100644 --- a/libavfilter/vf_blackdetect.c +++ b/libavfilter/vf_blackdetect.c @@ -80,8 +80,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_blackframe.c b/libavfilter/vf_blackframe.c index 1be9fcc..ad6d488 100644 --- a/libavfilter/vf_blackframe.c +++ b/libavfilter/vf_blackframe.c @@ -54,8 +54,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } #define SET_META(key, format, value) \ diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c index d232457..5fe7046 100644 --- a/libavfilter/vf_blend.c +++ b/libavfilter/vf_blend.c @@ -369,8 +369,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static av_cold void uninit(AVFilterContext *ctx) diff --git a/libavfilter/vf_boxblur.c b/libavfilter/vf_boxblur.c index bcf0ca5..17db949 100644 --- a/libavfilter/vf_boxblur.c +++ b/libavfilter/vf_boxblur.c @@ -128,8 +128,7 @@ static int query_formats(AVFilterContext *ctx) ff_add_format(&formats, fmt); } - ff_set_common_formats(ctx, formats); - return 0; + return ff_set_common_formats(ctx, formats); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_colorchannelmixer.c b/libavfilter/vf_colorchannelmixer.c index fca382e..0fffd34 100644 --- a/libavfilter/vf_colorchannelmixer.c +++ b/libavfilter/vf_colorchannelmixer.c @@ -81,8 +81,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int config_output(AVFilterLink *outlink) diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c index 4ceea66..7157c91 100644 --- a/libavfilter/vf_colorlevels.c +++ b/libavfilter/vf_colorlevels.c @@ -84,8 +84,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c index a2f029a..6f7e5d4 100644 --- a/libavfilter/vf_crop.c +++ b/libavfilter/vf_crop.c @@ -102,8 +102,7 @@ static int query_formats(AVFilterContext *ctx) ff_add_format(&formats, fmt); } - ff_set_common_formats(ctx, formats); - return 0; + return ff_set_common_formats(ctx, formats); } static av_cold void uninit(AVFilterContext *ctx) diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c index e8492cd..485ae69 100644 --- a/libavfilter/vf_cropdetect.c +++ b/libavfilter/vf_cropdetect.c @@ -62,8 +62,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int checkline(void *ctx, const unsigned char *src, int stride, int len, int bpp) diff --git a/libavfilter/vf_detelecine.c b/libavfilter/vf_detelecine.c index 8ad7ae3..44379a3 100644 --- a/libavfilter/vf_detelecine.c +++ b/libavfilter/vf_detelecine.c @@ -126,8 +126,7 @@ static int query_formats(AVFilterContext *ctx) ff_add_format(&pix_fmts, fmt); } - ff_set_common_formats(ctx, pix_fmts); - return 0; + return ff_set_common_formats(ctx, pix_fmts); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index a955d09..37eb231 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -682,8 +682,7 @@ static av_cold int init(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0)); - return 0; + return ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0)); } static int glyph_enu_free(void *opaque, void *elem) diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c index a7597cd..ab2dccf 100644 --- a/libavfilter/vf_fade.c +++ b/libavfilter/vf_fade.c @@ -115,12 +115,15 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE }; + AVFilterFormats *fmts_list; if (s->black_fade) - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); + fmts_list = ff_make_format_list(pix_fmts); else - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts_rgb)); - return 0; + fmts_list = ff_make_format_list(pix_fmts_rgb); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } const static enum AVPixelFormat studio_level_pix_fmts[] = { diff --git a/libavfilter/vf_fftfilt.c b/libavfilter/vf_fftfilt.c index dff279c..dd522fa 100644 --- a/libavfilter/vf_fftfilt.c +++ b/libavfilter/vf_fftfilt.c @@ -307,9 +307,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pixel_fmts_fftfilt)); - - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pixel_fmts_fftfilt); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static const AVFilterPad fftfilt_inputs[] = { diff --git a/libavfilter/vf_format.c b/libavfilter/vf_format.c index 96cb7fd..1fb3442 100644 --- a/libavfilter/vf_format.c +++ b/libavfilter/vf_format.c @@ -134,8 +134,7 @@ static int query_formats(AVFilterContext *ctx) if (!formats) return AVERROR(ENOMEM); - ff_set_common_formats(ctx, formats); - return 0; + return ff_set_common_formats(ctx, formats); } diff --git a/libavfilter/vf_framepack.c b/libavfilter/vf_framepack.c index 285381d..e9b9ed1 100644 --- a/libavfilter/vf_framepack.c +++ b/libavfilter/vf_framepack.c @@ -61,8 +61,10 @@ static const enum AVPixelFormat formats_supported[] = { static int query_formats(AVFilterContext *ctx) { // this will ensure that formats are the same on all pads - ff_set_common_formats(ctx, ff_make_format_list(formats_supported)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(formats_supported); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static av_cold void framepack_uninit(AVFilterContext *ctx) diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c index e5d5e11..bbefe51 100644 --- a/libavfilter/vf_frei0r.c +++ b/libavfilter/vf_frei0r.c @@ -385,8 +385,7 @@ static int query_formats(AVFilterContext *ctx) if (!formats) return AVERROR(ENOMEM); - ff_set_common_formats(ctx, formats); - return 0; + return ff_set_common_formats(ctx, formats); } static int filter_frame(AVFilterLink *inlink, AVFrame *in) diff --git a/libavfilter/vf_fspp.c b/libavfilter/vf_fspp.c index 5283ef8..7bdaa91 100644 --- a/libavfilter/vf_fspp.c +++ b/libavfilter/vf_fspp.c @@ -501,8 +501,11 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_GBRP, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_geq.c b/libavfilter/vf_geq.c index b0f53a6..887594f 100644 --- a/libavfilter/vf_geq.c +++ b/libavfilter/vf_geq.c @@ -176,11 +176,15 @@ static int geq_query_formats(AVFilterContext *ctx) AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_NONE }; + AVFilterFormats *fmts_list; + if (geq->is_rgb) { - ff_set_common_formats(ctx, ff_make_format_list(rgb_pix_fmts)); + fmts_list = ff_make_format_list(rgb_pix_fmts); } else - ff_set_common_formats(ctx, ff_make_format_list(yuv_pix_fmts)); - return 0; + fmts_list = ff_make_format_list(yuv_pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int geq_config_props(AVFilterLink *inlink) diff --git a/libavfilter/vf_hflip.c b/libavfilter/vf_hflip.c index 519a609..362bd01 100644 --- a/libavfilter/vf_hflip.c +++ b/libavfilter/vf_hflip.c @@ -55,8 +55,7 @@ static int query_formats(AVFilterContext *ctx) ff_add_format(&pix_fmts, fmt); } - ff_set_common_formats(ctx, pix_fmts); - return 0; + return ff_set_common_formats(ctx, pix_fmts); } static int config_props(AVFilterLink *inlink) diff --git a/libavfilter/vf_histogram.c b/libavfilter/vf_histogram.c index 40ec400..31004b7 100644 --- a/libavfilter/vf_histogram.c +++ b/libavfilter/vf_histogram.c @@ -105,6 +105,7 @@ static int query_formats(AVFilterContext *ctx) { HistogramContext *h = ctx->priv; const enum AVPixelFormat *pix_fmts; + AVFilterFormats *fmts_list; switch (h->mode) { case MODE_WAVEFORM: @@ -121,9 +122,10 @@ static int query_formats(AVFilterContext *ctx) av_assert0(0); } - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - - return 0; + fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static const uint8_t black_yuva_color[4] = { 0, 127, 127, 255 }; diff --git a/libavfilter/vf_il.c b/libavfilter/vf_il.c index 2501ef8..edb58d0 100644 --- a/libavfilter/vf_il.c +++ b/libavfilter/vf_il.c @@ -92,8 +92,7 @@ static int query_formats(AVFilterContext *ctx) ff_add_format(&formats, fmt); } - ff_set_common_formats(ctx, formats); - return 0; + return ff_set_common_formats(ctx, formats); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_interlace.c b/libavfilter/vf_interlace.c index 93a83aa..a520776 100644 --- a/libavfilter/vf_interlace.c +++ b/libavfilter/vf_interlace.c @@ -76,8 +76,10 @@ static const enum AVPixelFormat formats_supported[] = { static int query_formats(AVFilterContext *ctx) { - ff_set_common_formats(ctx, ff_make_format_list(formats_supported)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(formats_supported); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static av_cold void uninit(AVFilterContext *ctx) diff --git a/libavfilter/vf_kerndeint.c b/libavfilter/vf_kerndeint.c index 1158fdb..0e2417a 100644 --- a/libavfilter/vf_kerndeint.c +++ b/libavfilter/vf_kerndeint.c @@ -78,9 +78,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int config_props(AVFilterLink *inlink) diff --git a/libavfilter/vf_noise.c b/libavfilter/vf_noise.c index 4acad8a..861ac09 100644 --- a/libavfilter/vf_noise.c +++ b/libavfilter/vf_noise.c @@ -141,8 +141,7 @@ static int query_formats(AVFilterContext *ctx) ff_add_format(&formats, fmt); } - ff_set_common_formats(ctx, formats); - return 0; + return ff_set_common_formats(ctx, formats); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c index 2d9b9d0..63dc6a8 100644 --- a/libavfilter/vf_pad.c +++ b/libavfilter/vf_pad.c @@ -73,8 +73,7 @@ enum var_name { static int query_formats(AVFilterContext *ctx) { - ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0)); - return 0; + return ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0)); } typedef struct PadContext { diff --git a/libavfilter/vf_perspective.c b/libavfilter/vf_perspective.c index 2f2032e..970870c 100644 --- a/libavfilter/vf_perspective.c +++ b/libavfilter/vf_perspective.c @@ -93,8 +93,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static inline double get_coeff(double d) diff --git a/libavfilter/vf_phase.c b/libavfilter/vf_phase.c index 1818355..35c343f 100644 --- a/libavfilter/vf_phase.c +++ b/libavfilter/vf_phase.c @@ -77,8 +77,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_pp.c b/libavfilter/vf_pp.c index ff60e61..bac1d53 100644 --- a/libavfilter/vf_pp.c +++ b/libavfilter/vf_pp.c @@ -85,8 +85,11 @@ static int pp_query_formats(AVFilterContext *ctx) AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int pp_config_props(AVFilterLink *inlink) diff --git a/libavfilter/vf_pp7.c b/libavfilter/vf_pp7.c index 4761728..9e78c39 100644 --- a/libavfilter/vf_pp7.c +++ b/libavfilter/vf_pp7.c @@ -274,8 +274,11 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_GBRP, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_psnr.c b/libavfilter/vf_psnr.c index a76a9f9..406be88 100644 --- a/libavfilter/vf_psnr.c +++ b/libavfilter/vf_psnr.c @@ -232,8 +232,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int config_input_ref(AVFilterLink *inlink) diff --git a/libavfilter/vf_pullup.c b/libavfilter/vf_pullup.c index c38d0bb..ea15019 100644 --- a/libavfilter/vf_pullup.c +++ b/libavfilter/vf_pullup.c @@ -63,8 +63,11 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } #define ABS(a) (((a) ^ ((a) >> 31)) - ((a) >> 31)) diff --git a/libavfilter/vf_removelogo.c b/libavfilter/vf_removelogo.c index dd7629f..94b92a5 100644 --- a/libavfilter/vf_removelogo.c +++ b/libavfilter/vf_removelogo.c @@ -206,8 +206,10 @@ static void convert_mask_to_strength_mask(uint8_t *data, int linesize, static int query_formats(AVFilterContext *ctx) { static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int load_mask(uint8_t **mask, int *w, int *h, diff --git a/libavfilter/vf_repeatfields.c b/libavfilter/vf_repeatfields.c index 5dbfd52..b9e73ec 100644 --- a/libavfilter/vf_repeatfields.c +++ b/libavfilter/vf_repeatfields.c @@ -50,9 +50,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pixel_fmts_eq)); - - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pixel_fmts_eq); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_rotate.c b/libavfilter/vf_rotate.c index e5eff6b..46ab796 100644 --- a/libavfilter/vf_rotate.c +++ b/libavfilter/vf_rotate.c @@ -145,8 +145,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static double get_rotated_w(void *opaque, double angle) diff --git a/libavfilter/vf_sab.c b/libavfilter/vf_sab.c index b8bf1bc..da59439 100644 --- a/libavfilter/vf_sab.c +++ b/libavfilter/vf_sab.c @@ -65,9 +65,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_YUV411P, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } #define RADIUS_MIN 0.1 diff --git a/libavfilter/vf_signalstats.c b/libavfilter/vf_signalstats.c index e89bd79..88b715e 100644 --- a/libavfilter/vf_signalstats.c +++ b/libavfilter/vf_signalstats.c @@ -118,8 +118,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static AVFrame *alloc_frame(enum AVPixelFormat pixfmt, int w, int h) diff --git a/libavfilter/vf_smartblur.c b/libavfilter/vf_smartblur.c index b09ec90..169f540 100644 --- a/libavfilter/vf_smartblur.c +++ b/libavfilter/vf_smartblur.c @@ -124,9 +124,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int alloc_sws_context(FilterParam *f, int width, int height, unsigned int flags) diff --git a/libavfilter/vf_spp.c b/libavfilter/vf_spp.c index 19c2c72..b75f5f3 100644 --- a/libavfilter/vf_spp.c +++ b/libavfilter/vf_spp.c @@ -319,8 +319,11 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_GBRP10, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_stereo3d.c b/libavfilter/vf_stereo3d.c index d86a7f2..771bdde 100644 --- a/libavfilter/vf_stereo3d.c +++ b/libavfilter/vf_stereo3d.c @@ -256,6 +256,7 @@ static int query_formats(AVFilterContext *ctx) { Stereo3DContext *s = ctx->priv; const enum AVPixelFormat *pix_fmts; + AVFilterFormats *fmts_list; switch (s->out.format) { case ANAGLYPH_GM_COLOR: @@ -278,9 +279,10 @@ static int query_formats(AVFilterContext *ctx) pix_fmts = other_pix_fmts; } - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - - return 0; + fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int config_output(AVFilterLink *outlink) diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c index 90416b5..5e1324c 100644 --- a/libavfilter/vf_subtitles.c +++ b/libavfilter/vf_subtitles.c @@ -129,8 +129,7 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0)); - return 0; + return ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0)); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_super2xsai.c b/libavfilter/vf_super2xsai.c index 686dac1..67e9f97 100644 --- a/libavfilter/vf_super2xsai.c +++ b/libavfilter/vf_super2xsai.c @@ -241,8 +241,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_swapuv.c b/libavfilter/vf_swapuv.c index 175e39c..632e31c 100644 --- a/libavfilter/vf_swapuv.c +++ b/libavfilter/vf_swapuv.c @@ -79,8 +79,7 @@ static int query_formats(AVFilterContext *ctx) ff_add_format(&formats, fmt); } - ff_set_common_formats(ctx, formats); - return 0; + return ff_set_common_formats(ctx, formats); } static const AVFilterPad swapuv_inputs[] = { diff --git a/libavfilter/vf_telecine.c b/libavfilter/vf_telecine.c index 93e5aa9..26f0ef8 100644 --- a/libavfilter/vf_telecine.c +++ b/libavfilter/vf_telecine.c @@ -112,8 +112,7 @@ static int query_formats(AVFilterContext *ctx) ff_add_format(&pix_fmts, fmt); } - ff_set_common_formats(ctx, pix_fmts); - return 0; + return ff_set_common_formats(ctx, pix_fmts); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_thumbnail.c b/libavfilter/vf_thumbnail.c index 1883154..d70d063 100644 --- a/libavfilter/vf_thumbnail.c +++ b/libavfilter/vf_thumbnail.c @@ -203,8 +203,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static const AVFilterPad thumbnail_inputs[] = { diff --git a/libavfilter/vf_tile.c b/libavfilter/vf_tile.c index 459ae46..4756977 100644 --- a/libavfilter/vf_tile.c +++ b/libavfilter/vf_tile.c @@ -87,8 +87,7 @@ static av_cold int init(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0)); - return 0; + return ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0)); } static int config_props(AVFilterLink *outlink) diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index f3411f9..096a614 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -81,8 +81,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static void lowpass_line_c(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp, diff --git a/libavfilter/vf_transpose.c b/libavfilter/vf_transpose.c index dd570e6..911329c 100644 --- a/libavfilter/vf_transpose.c +++ b/libavfilter/vf_transpose.c @@ -75,8 +75,7 @@ static int query_formats(AVFilterContext *ctx) } - ff_set_common_formats(ctx, pix_fmts); - return 0; + return ff_set_common_formats(ctx, pix_fmts); } static int config_props_output(AVFilterLink *outlink) diff --git a/libavfilter/vf_unsharp.c b/libavfilter/vf_unsharp.c index 2b8d046..d5f5018 100644 --- a/libavfilter/vf_unsharp.c +++ b/libavfilter/vf_unsharp.c @@ -163,9 +163,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int init_filter_param(AVFilterContext *ctx, UnsharpFilterParam *fp, const char *effect_type, int width) diff --git a/libavfilter/vf_uspp.c b/libavfilter/vf_uspp.c index 6ce3e59..82ee997 100644 --- a/libavfilter/vf_uspp.c +++ b/libavfilter/vf_uspp.c @@ -293,8 +293,11 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_vidstabdetect.c b/libavfilter/vf_vidstabdetect.c index 1df6f74..d8f70f9 100644 --- a/libavfilter/vf_vidstabdetect.c +++ b/libavfilter/vf_vidstabdetect.c @@ -93,8 +93,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_vidstabtransform.c b/libavfilter/vf_vidstabtransform.c index 9db6a46..97e6661 100644 --- a/libavfilter/vf_vidstabtransform.c +++ b/libavfilter/vf_vidstabtransform.c @@ -132,8 +132,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } diff --git a/libavfilter/vf_vignette.c b/libavfilter/vf_vignette.c index 5f4c5fa..69ac6d7 100644 --- a/libavfilter/vf_vignette.c +++ b/libavfilter/vf_vignette.c @@ -136,8 +136,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static double get_natural_factor(const VignetteContext *s, int x, int y) diff --git a/libavfilter/vf_w3fdif.c b/libavfilter/vf_w3fdif.c index 3de7394..bb0316b 100644 --- a/libavfilter/vf_w3fdif.c +++ b/libavfilter/vf_w3fdif.c @@ -74,9 +74,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int config_input(AVFilterLink *inlink) diff --git a/libavfilter/vf_xbr.c b/libavfilter/vf_xbr.c index 5c14565..38c3b70 100644 --- a/libavfilter/vf_xbr.c +++ b/libavfilter/vf_xbr.c @@ -342,8 +342,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_0RGB32, AV_PIX_FMT_NONE, }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int filter_frame(AVFilterLink *inlink, AVFrame *in) diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c index ea72e62..b32f38b 100644 --- a/libavfilter/vf_yadif.c +++ b/libavfilter/vf_yadif.c @@ -461,9 +461,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int config_props(AVFilterLink *link) diff --git a/libavfilter/vf_zoompan.c b/libavfilter/vf_zoompan.c index 8f179e6..d126851 100644 --- a/libavfilter/vf_zoompan.c +++ b/libavfilter/vf_zoompan.c @@ -264,9 +264,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static av_cold void uninit(AVFilterContext *ctx) diff --git a/libavfilter/vsrc_cellauto.c b/libavfilter/vsrc_cellauto.c index 5e2df2d..4f4b01c 100644 --- a/libavfilter/vsrc_cellauto.c +++ b/libavfilter/vsrc_cellauto.c @@ -310,8 +310,10 @@ static int request_frame(AVFilterLink *outlink) static int query_formats(AVFilterContext *ctx) { static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static const AVFilterPad cellauto_outputs[] = { diff --git a/libavfilter/vsrc_life.c b/libavfilter/vsrc_life.c index 9410fbe..20bc56a 100644 --- a/libavfilter/vsrc_life.c +++ b/libavfilter/vsrc_life.c @@ -423,7 +423,11 @@ static int query_formats(AVFilterContext *ctx) pix_fmts[0] = AV_PIX_FMT_MONOBLACK; life->draw = fill_picture_monoblack; } - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); + + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + ff_set_common_formats(ctx, fmts_list); return 0; } diff --git a/libavfilter/vsrc_mandelbrot.c b/libavfilter/vsrc_mandelbrot.c index 66b0798..e26fecd 100644 --- a/libavfilter/vsrc_mandelbrot.c +++ b/libavfilter/vsrc_mandelbrot.c @@ -153,8 +153,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int config_props(AVFilterLink *inlink) diff --git a/libavfilter/vsrc_mptestsrc.c b/libavfilter/vsrc_mptestsrc.c index d93df7d..bc5b2cd 100644 --- a/libavfilter/vsrc_mptestsrc.c +++ b/libavfilter/vsrc_mptestsrc.c @@ -291,8 +291,10 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int request_frame(AVFilterLink *outlink) diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c index 8814440..7f981ba 100644 --- a/libavfilter/vsrc_testsrc.c +++ b/libavfilter/vsrc_testsrc.c @@ -202,8 +202,7 @@ static av_cold int color_init(AVFilterContext *ctx) static int color_query_formats(AVFilterContext *ctx) { - ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0)); - return 0; + return ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0)); } static int color_config_props(AVFilterLink *inlink) @@ -366,8 +365,11 @@ static int haldclutsrc_query_formats(AVFilterContext *ctx) AV_PIX_FMT_RGBA64, AV_PIX_FMT_BGRA64, AV_PIX_FMT_NONE, }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int haldclutsrc_config_props(AVFilterLink *outlink) @@ -646,8 +648,11 @@ static int test_query_formats(AVFilterContext *ctx) static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static const AVFilterPad avfilter_vsrc_testsrc_outputs[] = { @@ -754,8 +759,11 @@ static int rgbtest_query_formats(AVFilterContext *ctx) AV_PIX_FMT_RGB555, AV_PIX_FMT_BGR555, AV_PIX_FMT_NONE }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static int rgbtest_config_props(AVFilterLink *outlink) @@ -883,8 +891,11 @@ static int smptebars_query_formats(AVFilterContext *ctx) AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_NONE, }; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); - return 0; + + AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + if (!fmts_list) + return AVERROR(ENOMEM); + return ff_set_common_formats(ctx, fmts_list); } static const AVFilterPad smptebars_outputs[] = { |