diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2018-03-23 23:13:59 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2018-03-23 23:13:59 +0300 |
commit | 83f9782c25e7834aa5f17847294927e31e2f459f (patch) | |
tree | e08e8ca367eb1c3d9d263613e986c524e01c6631 | |
parent | 07a75a976836d98422c00171ff94d5f4b0ef6b02 (diff) |
Some missing checks
-rw-r--r-- | src/opus_decoder.c | 2 | ||||
-rw-r--r-- | src/opus_multistream_decoder.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/opus_decoder.c b/src/opus_decoder.c index ae358e49..60b5a962 100644 --- a/src/opus_decoder.c +++ b/src/opus_decoder.c @@ -769,6 +769,7 @@ int opus_decode_float(OpusDecoder *st, const unsigned char *data, else return OPUS_INVALID_PACKET; } + celt_assert(st->channels == 1 || st->channels == 2); ALLOC(out, frame_size*st->channels, opus_int16); ret = opus_decode_native(st, data, len, out, frame_size, decode_fec, 0, NULL, 0); @@ -806,6 +807,7 @@ int opus_decode(OpusDecoder *st, const unsigned char *data, else return OPUS_INVALID_PACKET; } + celt_assert(st->channels == 1 || st->channels == 2); ALLOC(out, frame_size*st->channels, float); ret = opus_decode_native(st, data, len, out, frame_size, decode_fec, 0, NULL, 1); diff --git a/src/opus_multistream_decoder.c b/src/opus_multistream_decoder.c index 39699fd0..f767ea0d 100644 --- a/src/opus_multistream_decoder.c +++ b/src/opus_multistream_decoder.c @@ -202,7 +202,7 @@ int opus_multistream_decode_native( VALIDATE_MS_DECODER(st); /* Limit frame_size to avoid excessive stack allocations. */ - opus_multistream_decoder_ctl(st, OPUS_GET_SAMPLE_RATE(&Fs)); + MUST_SUCCEED(opus_multistream_decoder_ctl(st, OPUS_GET_SAMPLE_RATE(&Fs))); frame_size = IMIN(frame_size, Fs/25*3); ALLOC(buf, 2*frame_size, opus_val16); ptr = (char*)st + align(sizeof(OpusMSDecoder)); |