Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2011-10-31 21:18:43 +0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2011-10-31 21:18:43 +0400
commit27592c3e49e458bda7d76ee26b4966dad4ccd130 (patch)
treef54c43e6e6a85e88d9b1a01fa6e8f05ec89b72e6 /src/opus_multistream.c
parentf8fc8f2960a5fe6816088fe31df495fc8bfd3ac1 (diff)
Multi-stream now checks that each stream at least contains a ToC.
Diffstat (limited to 'src/opus_multistream.c')
-rw-r--r--src/opus_multistream.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/opus_multistream.c b/src/opus_multistream.c
index 486a2cf7..945424fa 100644
--- a/src/opus_multistream.c
+++ b/src/opus_multistream.c
@@ -597,6 +597,7 @@ static int opus_multistream_decode_native(
int mono_size;
int s, i, c;
char *ptr;
+ int do_plc=0;
VARDECL(opus_val16, buf);
ALLOC_STACK;
@@ -605,8 +606,12 @@ static int opus_multistream_decode_native(
coupled_size = opus_decoder_get_size(2);
mono_size = opus_decoder_get_size(1);
+ if (len==0)
+ do_plc = 1;
if (len < 0)
return OPUS_BAD_ARG;
+ if (!do_plc && len < 2*st->layout.nb_streams-1)
+ return OPUS_INVALID_PACKET;
for (s=0;s<st->layout.nb_streams;s++)
{
OpusDecoder *dec;
@@ -615,7 +620,7 @@ static int opus_multistream_decode_native(
dec = (OpusDecoder*)ptr;
ptr += (s < st->layout.nb_coupled_streams) ? align(coupled_size) : align(mono_size);
- if (len<0)
+ if (!do_plc && len<=0)
{
RESTORE_STACK;
return OPUS_INVALID_PACKET;