Skip to content
Snippets Groups Projects
Commit 037918a8 authored by Vincent Penquerc'h's avatar Vincent Penquerc'h Committed by Jean-Marc Valin
Browse files

Guard against pathologically small buffer

parent ab0b5f5f
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
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