aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-usb-audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-usb-audio.c')
-rw-r--r--epan/dissectors/packet-usb-audio.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/epan/dissectors/packet-usb-audio.c b/epan/dissectors/packet-usb-audio.c
index ae8bb0b476..9dbd4267be 100644
--- a/epan/dissectors/packet-usb-audio.c
+++ b/epan/dissectors/packet-usb-audio.c
@@ -490,7 +490,7 @@ dissect_usb_audio_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tre
usb_conv_info_t *usb_conv_info;
proto_tree *tree;
proto_item *ti;
- gint offset;
+ gint offset = 0;
guint length = tvb_length(tvb);
@@ -501,24 +501,22 @@ dissect_usb_audio_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tre
col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBAUDIO");
- ti = proto_tree_add_protocol_format(parent_tree, proto_usb_audio, tvb, 0, -1, "USB Audio");
+ ti = proto_tree_add_protocol_format(parent_tree, proto_usb_audio, tvb, offset, -1, "USB Audio");
tree = proto_item_add_subtree(ti, ett_usb_audio);
switch (usb_conv_info->interfaceSubclass)
{
case AUDIO_IF_SUBCLASS_MIDISTREAMING:
- offset = 0;
col_set_str(pinfo->cinfo, COL_INFO, "USB-MIDI Event Packets");
- while (offset > 0 && (guint) offset < length)
+ while ((guint) offset < length)
{
dissect_usb_midi_event(tvb, pinfo, tree, parent_tree, offset);
offset += 4;
}
break;
default:
- offset = 0;
- proto_tree_add_expert(tree, pinfo, &ei_usb_audio_undecoded, tvb, offset, length - offset);
+ proto_tree_add_expert(tree, pinfo, &ei_usb_audio_undecoded, tvb, offset, length);
}
return tvb_length(tvb);