Loading system/stack/a2dp/a2dp_aac_encoder.cc +6 −2 Original line number Diff line number Diff line Loading @@ -631,8 +631,12 @@ static void a2dp_aac_encode_frames(uint8_t nb_frame) { */ *((uint32_t*)(p_buf + 1)) = a2dp_aac_encoder_cb.timestamp; a2dp_aac_encoder_cb.timestamp += p_buf->layer_specific * p_encoder_params->frame_length; // Timestamp will wrap over to 0 if stream continues on long enough // (>25H @ 48KHz). The parameters are promoted to 64bit to ensure that // no unsigned overflow is triggered as ubsan is always enabled. a2dp_aac_encoder_cb.timestamp = ((uint64_t)a2dp_aac_encoder_cb.timestamp + (p_buf->layer_specific * p_encoder_params->frame_length)) & UINT32_MAX; uint8_t done_nb_frame = remain_nb_frame - nb_frame; remain_nb_frame = nb_frame; Loading system/stack/a2dp/a2dp_sbc_encoder.cc +6 −1 Original line number Diff line number Diff line Loading @@ -538,7 +538,12 @@ static void a2dp_sbc_encode_frames(uint8_t nb_frame) { */ *((uint32_t*)(p_buf + 1)) = a2dp_sbc_encoder_cb.timestamp; a2dp_sbc_encoder_cb.timestamp += p_buf->layer_specific * blocm_x_subband; // Timestamp will wrap over to 0 if stream continues on long enough // (>25H @ 48KHz). The parameters are promoted to 64bit to ensure that // no unsigned overflow is triggered as ubsan is always enabled. a2dp_sbc_encoder_cb.timestamp = ((uint64_t)a2dp_sbc_encoder_cb.timestamp + (p_buf->layer_specific * blocm_x_subband)) & UINT32_MAX; uint8_t done_nb_frame = remain_nb_frame - nb_frame; remain_nb_frame = nb_frame; Loading system/stack/a2dp/a2dp_vendor_aptx_encoder.cc +7 −1 Original line number Diff line number Diff line Loading @@ -353,11 +353,17 @@ void a2dp_vendor_aptx_send_frames(uint64_t timestamp_us) { // Update the RTP timestamp *((uint32_t*)(p_buf + 1)) = a2dp_aptx_encoder_cb.timestamp; const uint8_t BYTES_PER_FRAME = 2; uint32_t rtp_timestamp = (pcm_bytes_encoded / a2dp_aptx_encoder_cb.feeding_params.channel_count) / BYTES_PER_FRAME; a2dp_aptx_encoder_cb.timestamp += rtp_timestamp; // Timestamp will wrap over to 0 if stream continues on long enough // (>25H @ 48KHz). The parameters are promoted to 64bit to ensure that // no unsigned overflow is triggered as ubsan is always enabled. a2dp_aptx_encoder_cb.timestamp = ((uint64_t)a2dp_aptx_encoder_cb.timestamp + rtp_timestamp) & UINT32_MAX; if (p_buf->len > 0) { a2dp_aptx_encoder_cb.enqueue_callback(p_buf, 1, bytes_read); Loading system/stack/a2dp/a2dp_vendor_aptx_hd_encoder.cc +6 −1 Original line number Diff line number Diff line Loading @@ -345,7 +345,12 @@ void a2dp_vendor_aptx_hd_send_frames(uint64_t timestamp_us) { (pcm_bytes_encoded / a2dp_aptx_hd_encoder_cb.feeding_params.channel_count) / BYTES_PER_FRAME; a2dp_aptx_hd_encoder_cb.timestamp += rtp_timestamp; // Timestamp will wrap over to 0 if stream continues on long enough // (>25H @ 48KHz). The parameters are promoted to 64bit to ensure that // no unsigned overflow is triggered as ubsan is always enabled. a2dp_aptx_hd_encoder_cb.timestamp = ((uint64_t)a2dp_aptx_hd_encoder_cb.timestamp + rtp_timestamp) & UINT32_MAX; if (p_buf->len > 0) { a2dp_aptx_hd_encoder_cb.enqueue_callback(p_buf, 1, bytes_read); Loading system/stack/a2dp/a2dp_vendor_ldac_encoder.cc +6 −1 Original line number Diff line number Diff line Loading @@ -511,7 +511,12 @@ static void a2dp_ldac_encode_frames(uint8_t nb_frame) { */ *((uint32_t*)(p_buf + 1)) = a2dp_ldac_encoder_cb.timestamp; a2dp_ldac_encoder_cb.timestamp += p_buf->layer_specific * ldac_frame_size; // Timestamp will wrap over to 0 if stream continues on long enough // (>25H @ 48KHz). The parameters are promoted to 64bit to ensure that // no unsigned overflow is triggered as ubsan is always enabled. a2dp_ldac_encoder_cb.timestamp = ((uint64_t)a2dp_ldac_encoder_cb.timestamp + (p_buf->layer_specific * ldac_frame_size)) & UINT32_MAX; uint8_t done_nb_frame = remain_nb_frame - nb_frame; remain_nb_frame = nb_frame; Loading Loading
system/stack/a2dp/a2dp_aac_encoder.cc +6 −2 Original line number Diff line number Diff line Loading @@ -631,8 +631,12 @@ static void a2dp_aac_encode_frames(uint8_t nb_frame) { */ *((uint32_t*)(p_buf + 1)) = a2dp_aac_encoder_cb.timestamp; a2dp_aac_encoder_cb.timestamp += p_buf->layer_specific * p_encoder_params->frame_length; // Timestamp will wrap over to 0 if stream continues on long enough // (>25H @ 48KHz). The parameters are promoted to 64bit to ensure that // no unsigned overflow is triggered as ubsan is always enabled. a2dp_aac_encoder_cb.timestamp = ((uint64_t)a2dp_aac_encoder_cb.timestamp + (p_buf->layer_specific * p_encoder_params->frame_length)) & UINT32_MAX; uint8_t done_nb_frame = remain_nb_frame - nb_frame; remain_nb_frame = nb_frame; Loading
system/stack/a2dp/a2dp_sbc_encoder.cc +6 −1 Original line number Diff line number Diff line Loading @@ -538,7 +538,12 @@ static void a2dp_sbc_encode_frames(uint8_t nb_frame) { */ *((uint32_t*)(p_buf + 1)) = a2dp_sbc_encoder_cb.timestamp; a2dp_sbc_encoder_cb.timestamp += p_buf->layer_specific * blocm_x_subband; // Timestamp will wrap over to 0 if stream continues on long enough // (>25H @ 48KHz). The parameters are promoted to 64bit to ensure that // no unsigned overflow is triggered as ubsan is always enabled. a2dp_sbc_encoder_cb.timestamp = ((uint64_t)a2dp_sbc_encoder_cb.timestamp + (p_buf->layer_specific * blocm_x_subband)) & UINT32_MAX; uint8_t done_nb_frame = remain_nb_frame - nb_frame; remain_nb_frame = nb_frame; Loading
system/stack/a2dp/a2dp_vendor_aptx_encoder.cc +7 −1 Original line number Diff line number Diff line Loading @@ -353,11 +353,17 @@ void a2dp_vendor_aptx_send_frames(uint64_t timestamp_us) { // Update the RTP timestamp *((uint32_t*)(p_buf + 1)) = a2dp_aptx_encoder_cb.timestamp; const uint8_t BYTES_PER_FRAME = 2; uint32_t rtp_timestamp = (pcm_bytes_encoded / a2dp_aptx_encoder_cb.feeding_params.channel_count) / BYTES_PER_FRAME; a2dp_aptx_encoder_cb.timestamp += rtp_timestamp; // Timestamp will wrap over to 0 if stream continues on long enough // (>25H @ 48KHz). The parameters are promoted to 64bit to ensure that // no unsigned overflow is triggered as ubsan is always enabled. a2dp_aptx_encoder_cb.timestamp = ((uint64_t)a2dp_aptx_encoder_cb.timestamp + rtp_timestamp) & UINT32_MAX; if (p_buf->len > 0) { a2dp_aptx_encoder_cb.enqueue_callback(p_buf, 1, bytes_read); Loading
system/stack/a2dp/a2dp_vendor_aptx_hd_encoder.cc +6 −1 Original line number Diff line number Diff line Loading @@ -345,7 +345,12 @@ void a2dp_vendor_aptx_hd_send_frames(uint64_t timestamp_us) { (pcm_bytes_encoded / a2dp_aptx_hd_encoder_cb.feeding_params.channel_count) / BYTES_PER_FRAME; a2dp_aptx_hd_encoder_cb.timestamp += rtp_timestamp; // Timestamp will wrap over to 0 if stream continues on long enough // (>25H @ 48KHz). The parameters are promoted to 64bit to ensure that // no unsigned overflow is triggered as ubsan is always enabled. a2dp_aptx_hd_encoder_cb.timestamp = ((uint64_t)a2dp_aptx_hd_encoder_cb.timestamp + rtp_timestamp) & UINT32_MAX; if (p_buf->len > 0) { a2dp_aptx_hd_encoder_cb.enqueue_callback(p_buf, 1, bytes_read); Loading
system/stack/a2dp/a2dp_vendor_ldac_encoder.cc +6 −1 Original line number Diff line number Diff line Loading @@ -511,7 +511,12 @@ static void a2dp_ldac_encode_frames(uint8_t nb_frame) { */ *((uint32_t*)(p_buf + 1)) = a2dp_ldac_encoder_cb.timestamp; a2dp_ldac_encoder_cb.timestamp += p_buf->layer_specific * ldac_frame_size; // Timestamp will wrap over to 0 if stream continues on long enough // (>25H @ 48KHz). The parameters are promoted to 64bit to ensure that // no unsigned overflow is triggered as ubsan is always enabled. a2dp_ldac_encoder_cb.timestamp = ((uint64_t)a2dp_ldac_encoder_cb.timestamp + (p_buf->layer_specific * ldac_frame_size)) & UINT32_MAX; uint8_t done_nb_frame = remain_nb_frame - nb_frame; remain_nb_frame = nb_frame; Loading