mirror of
https://github.com/espressif/esp-idf.git
synced 2026-06-11 11:42:39 +02:00
Merge branch 'bugfix/vfs_uart_outof_bounds_read_v5.1' into 'release/v5.1'
vfs_uart: fix out-of-bounds read (v5.1) See merge request espressif/esp-idf!24312
This commit is contained in:
@@ -628,7 +628,7 @@ static uint32_t slider_filter_average(te_slider_handle_t slider_handle, uint32_t
|
||||
for (int win_idx = 0; win_idx < TE_SLD_DEFAULT_POS_FILTER_SIZE(s_te_sld_obj); win_idx++) { //Moving average filter
|
||||
position_average += slider_handle->pos_filter_window[win_idx];
|
||||
}
|
||||
position_average = position_average / TE_SLD_DEFAULT_POS_FILTER_SIZE(s_te_sld_obj) + 0.5;
|
||||
position_average = (uint32_t)((float)position_average / TE_SLD_DEFAULT_POS_FILTER_SIZE(s_te_sld_obj) + 0.5F);
|
||||
return position_average;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user