diff options
author | Alex Converse <aconverse@google.com> | 2011-05-10 15:10:31 -0700 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2011-05-10 20:07:15 -0700 |
commit | 918a5409532e1218b011b5c079beb4eb5f45fdd4 (patch) | |
tree | 590d3c7f3c667984099414221aad04d19937ff07 /libavcodec/resample.c | |
parent | 9f3d6ca4f16e9b1f6f89424e9d946bb3a6a40d91 (diff) | |
download | ffmpeg-918a5409532e1218b011b5c079beb4eb5f45fdd4.tar.gz |
Don't allow unsupported resampling configurations.
Diffstat (limited to 'libavcodec/resample.c')
-rw-r--r-- | libavcodec/resample.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/resample.c b/libavcodec/resample.c index 2185a11ad7..9f0599fb59 100644 --- a/libavcodec/resample.c +++ b/libavcodec/resample.c @@ -156,6 +156,11 @@ ReSampleContext *av_audio_resample_init(int output_channels, int input_channels, av_log(NULL, AV_LOG_ERROR, "Resampling with input channels greater than 2 unsupported.\n"); return NULL; } + if (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 and 1, 2 or 6 for stereo input.\n"); + return NULL; + } s = av_mallocz(sizeof(ReSampleContext)); if (!s) |