diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-05-03 22:32:38 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-05-03 22:32:38 -0300 |
commit | dd69aeceac3d1798d0869d8adfb44af883b5fb93 (patch) | |
tree | 717e9b909ada0661940f6f3d2bd5349c6424bbf1 /drivers/opus/opus_multistream_decoder.c | |
parent | 567cb691ec49844101247bb9dc34bc2722f6af4f (diff) | |
parent | b81d9e6d614a67fd58e2256e90055589205bfa30 (diff) |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'drivers/opus/opus_multistream_decoder.c')
-rw-r--r-- | drivers/opus/opus_multistream_decoder.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/opus/opus_multistream_decoder.c b/drivers/opus/opus_multistream_decoder.c index 43c695d815..25100edba2 100644 --- a/drivers/opus/opus_multistream_decoder.c +++ b/drivers/opus/opus_multistream_decoder.c @@ -24,10 +24,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#ifdef OPUS_ENABLED #include "opus/opus_config.h" -#endif #include "opus/opus_multistream.h" #include "opus/opus.h" @@ -75,7 +72,7 @@ int opus_multistream_decoder_init( char *ptr; if ((channels>255) || (channels<1) || (coupled_streams>streams) || - (coupled_streams+streams>255) || (streams<1) || (coupled_streams<0)) + (streams<1) || (coupled_streams<0) || (streams>255-coupled_streams)) return OPUS_BAD_ARG; st->layout.nb_channels = channels; @@ -119,7 +116,7 @@ OpusMSDecoder *opus_multistream_decoder_create( int ret; OpusMSDecoder *st; if ((channels>255) || (channels<1) || (coupled_streams>streams) || - (coupled_streams+streams>255) || (streams<1) || (coupled_streams<0)) + (streams<1) || (coupled_streams<0) || (streams>255-coupled_streams)) { if (error) *error = OPUS_BAD_ARG; @@ -317,7 +314,7 @@ static void opus_copy_channel_out_float( if (src != NULL) { for (i=0;i<frame_size;i++) -#if defined(OPUS_FIXED_POINT) +#if defined(FIXED_POINT) float_dst[i*dst_stride+dst_channel] = (1/32768.f)*src[i*src_stride]; #else float_dst[i*dst_stride+dst_channel] = src[i*src_stride]; @@ -346,7 +343,7 @@ static void opus_copy_channel_out_short( if (src != NULL) { for (i=0;i<frame_size;i++) -#if defined(OPUS_FIXED_POINT) +#if defined(FIXED_POINT) short_dst[i*dst_stride+dst_channel] = src[i*src_stride]; #else short_dst[i*dst_stride+dst_channel] = FLOAT2INT16(src[i*src_stride]); |