Commit 2e5321fc authored by Thomas Schlichter's avatar Thomas Schlichter Committed by Robert Schmidt

fix for 5G NR UL transform precoding

get_index_for_dmrs_lowpapr_seq() was accessing the array dmrs_ul_allocated_res[] out of bounds.
parent d08f3971
...@@ -122,23 +122,20 @@ int16_t *base_sequence_less_than_36(unsigned int M_ZC, ...@@ -122,23 +122,20 @@ int16_t *base_sequence_less_than_36(unsigned int M_ZC,
*********************************************************************/ *********************************************************************/
int16_t get_index_for_dmrs_lowpapr_seq(int16_t num_dmrs_res) { int16_t get_index_for_dmrs_lowpapr_seq(int16_t num_dmrs_res) {
int16_t index = -1; int16_t index = num_dmrs_res/6 - 1;
if (num_dmrs_res >= dmrs_ul_allocated_res[(MAX_INDEX_DMRS_UL_ALLOCATED_REs-1)]) if (index >= MAX_INDEX_DMRS_UL_ALLOCATED_REs)
index = MAX_INDEX_DMRS_UL_ALLOCATED_REs-1; index = MAX_INDEX_DMRS_UL_ALLOCATED_REs-1;
else
index = (num_dmrs_res/6) -1;
for (;index >= 0; index--) { for (;index >= 0; index--) {
if (dmrs_ul_allocated_res[index] == num_dmrs_res) if (dmrs_ul_allocated_res[index] == num_dmrs_res)
break; break;
} }
LOG_D(PHY, "num_dmrs_res: %d INDEX RETURNED: %d", num_dmrs_res, index); LOG_D(PHY, "num_dmrs_res: %d INDEX RETURNED: %d", num_dmrs_res, index);
return index;
return index;
} }
/******************************************************************* /*******************************************************************
......
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