Commit 207a2e86 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Fixes a rare integer overflow in the SILK "50% of max rate" rule

parent 591b7494
......@@ -753,7 +753,7 @@ int opus_encode_float(OpusEncoder *st, const opus_val16 *pcm, int frame_size,
}
}
/* SILK is not allow to use more than 50% of max_data_bytes */
if (max_data_bytes < 2*st->silk_mode.bitRate*frame_size / (st->Fs * 8))
if (max_data_bytes < st->silk_mode.bitRate*frame_size / (st->Fs * 4))
st->silk_mode.bitRate = max_data_bytes*st->Fs*4/frame_size;
st->silk_mode.payloadSize_ms = 1000 * frame_size / st->Fs;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment