summaryrefslogtreecommitdiff
path: root/cesar/ce/rx/bitloading/src/bitloading.c
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/ce/rx/bitloading/src/bitloading.c')
-rw-r--r--cesar/ce/rx/bitloading/src/bitloading.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cesar/ce/rx/bitloading/src/bitloading.c b/cesar/ce/rx/bitloading/src/bitloading.c
index 09d736eff3..bcca3dd0d7 100644
--- a/cesar/ce/rx/bitloading/src/bitloading.c
+++ b/cesar/ce/rx/bitloading/src/bitloading.c
@@ -149,8 +149,10 @@ ce_rx_bl_update_tone_map_at_ber_consign (u64 ber_pt,
u32 *tone_word;
s8 mod = -1;
- /* Optimize table until we reach the BER consign. */
- while (ber_pt * tm->bits_per_symbol >= ber_weighted_sum)
+ /* Optimize tone map until we reach the BER consign or we are out of
+ * table. */
+ while (ber_pt * tm->bits_per_symbol >= ber_weighted_sum
+ && pos < tonemask->carrier_nb)
{
/* Get the modulation of the lowest BER impact. */
mod = tonemap_get_tone (tm, opti[pos].carrier_index, &tone_word);