On Tue, May 10, 2011 at 4:01 PM, Alex Converse <aconve...@google.com> wrote: > --- > libavcodec/resample.c | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) >
Updated based on comments from [patch 2/2]
From d1309ce9ffd71d74b3e59efdd50375f8612f2262 Mon Sep 17 00:00:00 2001 From: Alex Converse <aconve...@google.com> Date: Tue, 10 May 2011 15:10:31 -0700 Subject: [PATCH 1/3] Don't allow unsupported resampling configurations. --- libavcodec/resample.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/libavcodec/resample.c b/libavcodec/resample.c index 2185a11..9f0599f 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) -- 1.7.3.1
_______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel