multistream: improve arg check
authorMark Harris <mark.hsj@gmail.com>
Thu, 27 Nov 2014 16:48:09 +0000 (08:48 -0800)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Thu, 27 Nov 2014 17:04:14 +0000 (12:04 -0500)
commit25b27a9c167302769db512a9e32c66323bc7904c
tree2c0df6c184b180fcf252f94a6389a23e42d04666
parentd10755e95c49f5ec925e70598877c82ad865a189
multistream: improve arg check

Avoid undefined behavior (signed arithmetic overflow) or
implementation-defined behavior (malloc(0)) on out-of-range arguments,
e.g. opus_multistream_encoder_create(48000, 2, 2147483647, 1, ...)
or opus_multistream_surround_encoder_create(48000, 3, 0, ...).

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
src/opus_multistream_decoder.c
src/opus_multistream_encoder.c