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/af_silencedetect.c | |
parent | 21e034a47a2b407f0896114a995fd507f0f5230f (diff) | |
download | ffmpeg-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/af_silencedetect.c')
-rw-r--r-- | libavfilter/af_silencedetect.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libavfilter/af_silencedetect.c b/libavfilter/af_silencedetect.c index 687d2e7ed1..b048d63738 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[] = { |