summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Harris <mark.hsj@gmail.com>2018-07-21 21:10:17 -0700
committerMark Harris <mark.hsj@gmail.com>2018-07-21 21:36:34 -0700
commit1827db6a601e02729475c4618500f49f8b0cbefa (patch)
treef6cd3ed929a12b117e9766b314de108e95a00ad5 /src
parent01b035f8ba4f48e9e1ad9f9407f77ce9a7e4aa44 (diff)
downloadopus-1827db6a601e02729475c4618500f49f8b0cbefa.tar.gz
Validate multistream/projection decoder frame_size
Diffstat (limited to 'src')
-rw-r--r--src/opus_multistream_decoder.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/opus_multistream_decoder.c b/src/opus_multistream_decoder.c
index f767ea0d..e0bd4c66 100644
--- a/src/opus_multistream_decoder.c
+++ b/src/opus_multistream_decoder.c
@@ -201,6 +201,11 @@ int opus_multistream_decode_native(
ALLOC_STACK;
VALIDATE_MS_DECODER(st);
+ if (frame_size <= 0)
+ {
+ RESTORE_STACK;
+ return OPUS_BAD_ARG;
+ }
/* Limit frame_size to avoid excessive stack allocations. */
MUST_SUCCEED(opus_multistream_decoder_ctl(st, OPUS_GET_SAMPLE_RATE(&Fs)));
frame_size = IMIN(frame_size, Fs/25*3);