ref: 207a2e8627ad371b4d1e7bc4d3a39fe97ef2999c
parent: 591b74945dda62afb08d9c964876c11d8ed387f7
author: Jean-Marc Valin <[email protected]>
date: Sat Oct 8 11:08:38 EDT 2011
Fixes a rare integer overflow in the SILK "50% of max rate" rule
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -753,7 +753,7 @@
}
}
/* 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;