Sanitize input to opus_en/decoder_get_size.

This commit is contained in:
Gregory Maxwell 2011-09-04 10:47:15 -04:00
parent 50ef21c0a9
commit f451b33b16
2 changed files with 4 additions and 0 deletions

View file

@ -70,6 +70,8 @@ int opus_decoder_get_size(int channels)
{
int silkDecSizeBytes, celtDecSizeBytes;
int ret;
if (channels<1 || channels > 2)
return 0;
ret = silk_Get_Decoder_Size( &silkDecSizeBytes );
if(ret)
return 0;

View file

@ -124,6 +124,8 @@ int opus_encoder_get_size(int channels)
{
int silkEncSizeBytes, celtEncSizeBytes;
int ret;
if (channels<1 || channels > 2)
return 0;
ret = silk_Get_Encoder_Size( &silkEncSizeBytes );
if (ret)
return 0;