Fix the issue that directly uses params_len, from received PDU data, for arithmetic calculation and comparison. Reviewed-by: Alain Michaud <alainm@xxxxxxxxxxxx> Signed-off-by: Michael Sun <michaelfsun@xxxxxxxxxx> --- profiles/audio/avrcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c index ccf34b220..2265f87ab 100644 --- a/profiles/audio/avrcp.c +++ b/profiles/audio/avrcp.c @@ -1923,9 +1923,9 @@ static size_t handle_vendordep_pdu(struct avctp *conn, uint8_t transaction, operands += sizeof(*pdu); operand_count -= sizeof(*pdu); - if (pdu->params_len != operand_count) { + if (pdu->params_len != htons(operand_count)) { DBG("AVRCP PDU parameters length don't match"); - pdu->params_len = operand_count; + pdu->params_len = htons(operand_count); } for (handler = session->control_handlers; handler->pdu_id; handler++) { -- 2.32.0.rc1.229.g3e70b5a671-goog