Sanitize input to opus_en/decoder_get_size.
This commit is contained in:
parent
50ef21c0a9
commit
f451b33b16
2 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue