Showing
1 changed file
with
7 additions
and
0 deletions
| @@ -705,6 +705,13 @@ void optek_link_rx_cb(u8 *buf, u16 len, u8 bc_index, u16 pt_end_time, u8 role, u | @@ -705,6 +705,13 @@ void optek_link_rx_cb(u8 *buf, u16 len, u8 bc_index, u16 pt_end_time, u8 role, u | ||
| 705 | //if (len) | 705 | //if (len) |
| 706 | // key_value = buf[len-1]; | 706 | // key_value = buf[len-1]; |
| 707 | 707 | ||
| 708 | + | ||
| 709 | + if (len < 10) | ||
| 710 | + { | ||
| 711 | + // maybe the data is empty or commands/states | ||
| 712 | + return; | ||
| 713 | + } | ||
| 714 | + | ||
| 708 | memcpy(rx_data_buf,buf,len); | 715 | memcpy(rx_data_buf,buf,len); |
| 709 | 716 | ||
| 710 | if (optek_link_mode == GAME_HEADPHONE_PT_5MS_LP || optek_link_mode == GAME_HEADPHONE_PT7P5MS_T7R3E) | 717 | if (optek_link_mode == GAME_HEADPHONE_PT_5MS_LP || optek_link_mode == GAME_HEADPHONE_PT7P5MS_T7R3E) |
Please
register
or
login
to post a comment