diff options
author | Paul B Mahol <onemda@gmail.com> | 2015-04-03 20:55:18 +0300 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2015-04-08 16:05:06 +0300 |
commit | a0854c084ea1541591c54aaab1f993ebaf92ffaf (patch) | |
tree | 1ebc69023a4f7eb471ce60ff4784b146a8b9973f /libavfilter/vsrc_testsrc.c | |
parent | 21e034a47a2b407f0896114a995fd507f0f5230f (diff) |
avfilter: handle error in query_formats() in bunch of filters
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/vsrc_testsrc.c')
-rw-r--r-- | libavfilter/vsrc_testsrc.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c index 8814440760..7f981bad23 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[] = { |