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
path: root/src
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2011-11-22 19:12:44 +0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2012-03-06 04:59:17 +0400
commit037918a8fe31469fe69c607a9e4a68caaf9a4e6d (patch)
treed6b6522788345977f3fea4d8a39cd1392fecfb4f /src
parentab0b5f5ff388f70a81b4497beef6d7562ebc4068 (diff)
Guard against pathologically small buffer
Diffstat (limited to 'src')
-rw-r--r--src/opus_encoder.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/opus_encoder.c b/src/opus_encoder.c
index 5dda6652..c00bc2f8 100644
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -1212,6 +1212,11 @@ int opus_encode_float(OpusEncoder *st, const opus_val16 *pcm, int frame_size,
the decoder to call the PLC */
if (ec_tell(&enc) > (max_data_bytes-1)*8)
{
+ if (max_data_bytes < 2)
+ {
+ RESTORE_STACK;
+ return OPUS_BUFFER_TOO_SMALL;
+ }
data[1] = 0;
ret = 1;
st->rangeFinal = 0;