diff options
author | Marie Janssen <jamuraa@google.com> | 2017-07-10 13:14:07 -0700 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-07-19 03:42:21 +0000 |
commit | d0e8b26ee2695246a4e3baa37d4384e6c2e634d3 (patch) | |
tree | fdbdc04135e3dbdfaa0b376ec72f2152d414ed0c /epan | |
parent | abfa43aa270d92219f0784c725fe31cad1cdbc69 (diff) |
AVRCP: fix parsing of Media Player Items
From the AVRCP 1.6.1 spec, page 76, the "Player ID" is two octets.
Also, the Play Status field comes before the Feature Bit Mask.
Change-Id: Ifd0ad82650d395395b16f9441f02b8835befa360
Reviewed-on: https://code.wireshark.org/review/22709
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-btavrcp.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/epan/dissectors/packet-btavrcp.c b/epan/dissectors/packet-btavrcp.c index 44365cb31b..52ea6214f3 100644 --- a/epan/dissectors/packet-btavrcp.c +++ b/epan/dissectors/packet-btavrcp.c @@ -686,8 +686,8 @@ dissect_item_mediaplayer(tvbuff_t *tvb, proto_tree *tree, gint offset) proto_tree *features_not_set_tree; item_length = tvb_get_ntohs(tvb, offset + 1); - displayable_name_length = tvb_get_ntohs(tvb, offset + 1 + 2 + 1 + 1 + 4 + 16 + 1 + 2); - displayable_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1 + 2 + 1 + 1 + 4 + 16 + 1 + 2 + 2, displayable_name_length, ENC_ASCII); + displayable_name_length = tvb_get_ntohs(tvb, offset + 1 + 2 + 2 + 1 + 4 + 16 + 1 + 2); + displayable_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1 + 2 + 2 + 1 + 4 + 16 + 1 + 2 + 2, displayable_name_length, ENC_ASCII); pitem = proto_tree_add_none_format(tree, hf_btavrcp_player_item, tvb, offset, 1 + 2 + item_length, "Player: %s", displayable_name); ptree = proto_item_add_subtree(pitem, ett_btavrcp_player); @@ -697,8 +697,8 @@ dissect_item_mediaplayer(tvbuff_t *tvb, proto_tree *tree, gint offset) proto_tree_add_item(ptree, hf_btavrcp_item_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; - proto_tree_add_item(ptree, hf_btavrcp_player_id, tvb, offset, 1, ENC_BIG_ENDIAN); - offset += 1; + proto_tree_add_item(ptree, hf_btavrcp_player_id, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; proto_tree_add_item(ptree, hf_btavrcp_major_player_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -706,6 +706,9 @@ dissect_item_mediaplayer(tvbuff_t *tvb, proto_tree *tree, gint offset) proto_tree_add_item(ptree, hf_btavrcp_player_subtype, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + proto_tree_add_item(ptree, hf_btavrcp_play_status, tvb, offset, 1, ENC_BIG_ENDIAN); + offset += 1; + /* feature bit mask */ features_item = proto_tree_add_item(ptree, hf_btavrcp_features, tvb, offset, 16, ENC_NA); features_tree = proto_item_add_subtree(features_item, ett_btavrcp_features); @@ -818,9 +821,6 @@ dissect_item_mediaplayer(tvbuff_t *tvb, proto_tree *tree, gint offset) } offset += 16; - proto_tree_add_item(ptree, hf_btavrcp_play_status, tvb, offset, 1, ENC_BIG_ENDIAN); - offset += 1; - proto_tree_add_item(ptree, hf_btavrcp_character_set, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; |