Skip to content
Snippets Groups Projects
Commit d060dd7c authored by Gregory Maxwell's avatar Gregory Maxwell
Browse files

Opus_multistream API hardening.

parent ce878836
No related branches found
No related tags found
No related merge requests found
......@@ -163,6 +163,10 @@ int opus_multistream_encoder_init(
int i;
char *ptr;
if ((channels>255) || (coupled_streams>streams) ||
(coupled_streams+streams>255) || (streams<1) || (coupled_streams<0))
return OPUS_BAD_ARG;
st->layout.nb_channels = channels;
st->layout.nb_streams = streams;
st->layout.nb_coupled_streams = coupled_streams;
......@@ -534,6 +538,10 @@ int opus_multistream_decoder_init(
int i, ret;
char *ptr;
if ((channels>255) || (coupled_streams>streams) ||
(coupled_streams+streams>255) || (streams<1) || (coupled_streams<0))
return OPUS_BAD_ARG;
st->layout.nb_channels = channels;
st->layout.nb_streams = streams;
st->layout.nb_coupled_streams = coupled_streams;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment