USB Audio: Fix parsing of v2 Endpoint Descriptor

dissect_usb_endpoint_descriptor() silently assumed that Audio Endpoint
Descriptor size is 9B.  In v2.0, the last two fields are absent.

Change-Id: I5758857fd2b26e2b3430874c313769862a2a87de
Reviewed-on: https://code.wireshark.org/review/37973
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Petr Janecek 2020-07-27 02:41:23 +02:00 committed by Anders Broman
parent 8c0c27e590
commit a71e225c40
1 changed files with 4 additions and 1 deletions

View File

@ -2562,7 +2562,10 @@ dissect_usb_endpoint_descriptor(packet_info *pinfo, proto_tree *parent_tree,
proto_tree_add_item(tree, hf_usb_bInterval, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
if (usb_conv_info && (usb_conv_info->interfaceClass == IF_CLASS_AUDIO)) {
/* bRefresh and bSynchAddress are present only in the Audio 1.0
* Endpoint Descriptors, so observe the descriptor size */
if (usb_conv_info && (usb_conv_info->interfaceClass == IF_CLASS_AUDIO)
&& (len >= 9)) {
proto_tree_add_item(tree, hf_usb_audio_bRefresh, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;