Skip to content
Snippets Groups Projects
Verified Commit 69bcb28d authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Some missing checks

parent 3995a0c1
No related branches found
No related tags found
No related merge requests found
...@@ -769,6 +769,7 @@ int opus_decode_float(OpusDecoder *st, const unsigned char *data, ...@@ -769,6 +769,7 @@ int opus_decode_float(OpusDecoder *st, const unsigned char *data,
else else
return OPUS_INVALID_PACKET; return OPUS_INVALID_PACKET;
} }
celt_assert(st->channels == 1 || st->channels == 2);
ALLOC(out, frame_size*st->channels, opus_int16); ALLOC(out, frame_size*st->channels, opus_int16);
ret = opus_decode_native(st, data, len, out, frame_size, decode_fec, 0, NULL, 0); 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, ...@@ -806,6 +807,7 @@ int opus_decode(OpusDecoder *st, const unsigned char *data,
else else
return OPUS_INVALID_PACKET; return OPUS_INVALID_PACKET;
} }
celt_assert(st->channels == 1 || st->channels == 2);
ALLOC(out, frame_size*st->channels, float); ALLOC(out, frame_size*st->channels, float);
ret = opus_decode_native(st, data, len, out, frame_size, decode_fec, 0, NULL, 1); ret = opus_decode_native(st, data, len, out, frame_size, decode_fec, 0, NULL, 1);
......
...@@ -202,7 +202,7 @@ int opus_multistream_decode_native( ...@@ -202,7 +202,7 @@ int opus_multistream_decode_native(
VALIDATE_MS_DECODER(st); VALIDATE_MS_DECODER(st);
/* Limit frame_size to avoid excessive stack allocations. */ /* 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); frame_size = IMIN(frame_size, Fs/25*3);
ALLOC(buf, 2*frame_size, opus_val16); ALLOC(buf, 2*frame_size, opus_val16);
ptr = (char*)st + align(sizeof(OpusMSDecoder)); ptr = (char*)st + align(sizeof(OpusMSDecoder));
......
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