diff mbox series

[BlueZ,1/2] monitor/avctp: Fix parsing of GetElementAttribute

Message ID 20220114220959.917157-1-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,1/2] monitor/avctp: Fix parsing of GetElementAttribute | expand

Commit Message

Luiz Augusto von Dentz Jan. 14, 2022, 10:09 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

AVRCP byte order is always big endian:

Audio/Video Remote Control / Profile Specification - Page 20:

 'Transfer Octet Order; Packets shall transfer multiple-octet fields in
 standard network octet order (Big Endian), with more significant
 (high-order) octets being transferred before less-significant (low-order)
 octets.'
---
 monitor/avctp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/monitor/avctp.c b/monitor/avctp.c
index dc03195a8..fb2628282 100644
--- a/monitor/avctp.c
+++ b/monitor/avctp.c
@@ -1192,7 +1192,7 @@  static bool avrcp_get_element_attributes(struct avctp_frame *avctp_frame,
 	for (; num > 0; num--) {
 		uint32_t attr;
 
-		if (!l2cap_frame_get_le32(frame, &attr))
+		if (!l2cap_frame_get_be32(frame, &attr))
 			return false;
 
 		print_field("%*cAttributeID: 0x%08x (%s)", (indent - 8),