Skip to content
Snippets Groups Projects
Commit 0e1b29ee authored by Hui Peng's avatar Hui Peng Committed by Android (Google) Code Review
Browse files

Merge "Fix a potential OOB read resulted from integer underflow" into tm-dev

parents 047a68b1 b6433f14
No related branches found
No related tags found
No related merge requests found
......@@ -518,6 +518,11 @@ bool A2DP_VendorBuildCodecHeaderLdac(UNUSED_ATTR const uint8_t* p_codec_info,
uint16_t frames_per_packet) {
uint8_t* p;
// there is a 4 byte timestamp right following p_buf
if (p_buf->offset < 4 + A2DP_LDAC_MPL_HDR_LEN) {
return false;
}
p_buf->offset -= A2DP_LDAC_MPL_HDR_LEN;
p = (uint8_t*)(p_buf + 1) + p_buf->offset;
p_buf->len += A2DP_LDAC_MPL_HDR_LEN;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment