audio/avrcp: Use host/network order as appropriate for pdu->params_len
authorMarijn Suijten <marijn.suijten@somainline.org>
Sun, 8 Aug 2021 14:35:26 +0000 (16:35 +0200)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:36 +0000 (19:08 +0530)
commitf3a68726bfeb94857e0fe39c4417085835613c8a
treef1e925d69fcf38b6a262fcd2614775260a6fab1c
parent9450aa1471f1cfdc4a2deea807a525ad988d7658
audio/avrcp: Use host/network order as appropriate for pdu->params_len

When comparing against or writing to pdu->params_len to enforce matching
length with total packet length, take into account that pdu->params_len
is in network order (big endian) while packet size (operand_count) is in
host order (usually little endian).

This silently breaks a number of AVRCP commands that perform a quick
length check based on params_len and bail if it doesn't match exactly.

Fixes: e2b0f0d8d ("avrcp: Fix not checking if params_len match number of received bytes")
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
profiles/audio/avrcp.c