aboutsummaryrefslogtreecommitdiff
path: root/src/opus_decoder.c
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2018-03-23 16:13:59 -0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2018-03-27 15:13:27 -0400
commit69bcb28d3ddb20231580bd09e44d87a769dabcb7 (patch)
tree2f77881efd1abd40ede3db650fd20a5bef6b1df3 /src/opus_decoder.c
parent3995a0c150511572280170280a348fab575edbe7 (diff)
downloadlibopus-69bcb28d3ddb20231580bd09e44d87a769dabcb7.tar.gz
Some missing checks
Diffstat (limited to 'src/opus_decoder.c')
-rw-r--r--src/opus_decoder.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/opus_decoder.c b/src/opus_decoder.c
index 483d918e..9113638a 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);