aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/af_pan.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-10 01:06:52 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-10 01:08:45 +0200
commitced765ceb32361af413f1510c074722fb6c9242d (patch)
treed969302301486483d394a798a54776fcd69a3d17 /libavfilter/af_pan.c
parentd9e7dc3e16645fca4e804113f13cb3c282b17dae (diff)
downloadffmpeg-ced765ceb32361af413f1510c074722fb6c9242d.tar.gz
avfilter/af_pan: check if the number of channels where sucessfully set
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/af_pan.c')
-rw-r--r--libavfilter/af_pan.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c
index 1b78515b55..36395e995c 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) {