[FFmpeg-cvslog] avfilter/af_pan: check if the number of channels where sucessfully set
Michael Niedermayer
git at videolan.org
Sun Aug 10 01:19:09 CEST 2014
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Aug 10 01:06:52 2014 +0200| [ced765ceb32361af413f1510c074722fb6c9242d] | committer: Michael Niedermayer
avfilter/af_pan: check if the number of channels where sucessfully set
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ced765ceb32361af413f1510c074722fb6c9242d
---
libavfilter/af_pan.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c
index 1b78515..36395e9 100644
--- a/libavfilter/af_pan.c
+++ b/libavfilter/af_pan.c
@@ -286,10 +286,14 @@ static int config_props(AVFilterLink *link)
0, ctx);
if (!pan->swr)
return AVERROR(ENOMEM);
- if (!link->channel_layout)
- av_opt_set_int(pan->swr, "ich", link->channels, 0);
- if (!pan->out_channel_layout)
- av_opt_set_int(pan->swr, "och", pan->nb_output_channels, 0);
+ if (!link->channel_layout) {
+ if (av_opt_set_int(pan->swr, "ich", link->channels, 0) < 0)
+ return AVERROR(EINVAL);
+ }
+ if (!pan->out_channel_layout) {
+ if (av_opt_set_int(pan->swr, "och", pan->nb_output_channels, 0) < 0)
+ return AVERROR(EINVAL);
+ }
// gains are pure, init the channel mapping
if (pan->pure_gains) {
More information about the ffmpeg-cvslog
mailing list