ref: f451b33b16b86789f7d5d6791cdbae7db9c6d62d
parent: 50ef21c0a9dc7e56e6ca8c00b50afae2f9fedc99
author: Gregory Maxwell <[email protected]>
date: Sun Sep 4 06:47:15 EDT 2011
Sanitize input to opus_en/decoder_get_size.
--- a/src/opus_decoder.c
+++ b/src/opus_decoder.c
@@ -70,6 +70,8 @@
{
int silkDecSizeBytes, celtDecSizeBytes;
int ret;
+ if (channels<1 || channels > 2)
+ return 0;
ret = silk_Get_Decoder_Size( &silkDecSizeBytes );
if(ret)
return 0;
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -124,6 +124,8 @@
{
int silkEncSizeBytes, celtEncSizeBytes;
int ret;
+ if (channels<1 || channels > 2)
+ return 0;
ret = silk_Get_Encoder_Size( &silkEncSizeBytes );
if (ret)
return 0;