From fc66793e1f7b19a2981754ca57b8499cd422c4ef Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Tue, 2 Jul 2013 16:35:02 -0400 Subject: Adds some checks to the surround API --- src/opus_multistream.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/opus_multistream.c b/src/opus_multistream.c index 9493ca31..a126b16f 100644 --- a/src/opus_multistream.c +++ b/src/opus_multistream.c @@ -272,6 +272,8 @@ int opus_multistream_surround_encoder_init( int application ) { + if ((channels>255) || (channels<1)) + return OPUS_BAD_ARG; st->lfe_stream = -1; if (mapping_family==0) { @@ -306,9 +308,8 @@ int opus_multistream_surround_encoder_init( mapping[i] = i; } else return OPUS_UNIMPLEMENTED; - opus_multistream_encoder_init_impl(st, Fs, channels, *streams, *coupled_streams, + return opus_multistream_encoder_init_impl(st, Fs, channels, *streams, *coupled_streams, mapping, application, channels>2&&mapping_family==1); - return OPUS_OK; } OpusMSEncoder *opus_multistream_encoder_create( -- cgit v1.2.3