summaryrefslogtreecommitdiff
path: root/libavcodec/resample.c
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2011-10-23 00:31:16 +0200
committerJanne Grunau <janne-libav@jannau.net>2011-10-25 12:06:48 +0200
commitb2e56e08c90a89c5566a1a391fec7c3136d49e3c (patch)
tree95db6bf0556d0ae834753bcedfdca9a1d7272952 /libavcodec/resample.c
parentec1ce86e7f7cf88dac5d4c00d7d5851e1202d6e2 (diff)
resample: reject unhandled conversions
audio_resample can not reduce the number of channels
Diffstat (limited to 'libavcodec/resample.c')
-rw-r--r--libavcodec/resample.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/resample.c b/libavcodec/resample.c
index fce6272e78..ba8ce8910c 100644
--- a/libavcodec/resample.c
+++ b/libavcodec/resample.c
@@ -162,9 +162,10 @@ ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
MAX_CHANNELS);
return NULL;
}
- if (output_channels > 2 &&
- !(output_channels == 6 && input_channels == 2) &&
- output_channels != input_channels) {
+ if (output_channels != input_channels &&
+ (input_channels > 2 ||
+ output_channels > 2 &&
+ !(output_channels == 6 && input_channels == 2))) {
av_log(NULL, AV_LOG_ERROR,
"Resampling output channel count must be 1 or 2 for mono input; 1, 2 or 6 for stereo input; or N for N channel input.\n");
return NULL;