diff options
author | Stephen Fisher <steve@stephen-fisher.com> | 2007-02-23 21:31:11 +0000 |
---|---|---|
committer | Stephen Fisher <steve@stephen-fisher.com> | 2007-02-23 21:31:11 +0000 |
commit | fe0e340bffb9dad19fe974185b28542b8de953d6 (patch) | |
tree | 082a144474bb4af9505e5fb9a6afc871033fd6fc /epan | |
parent | 46956317e2ef6ce7600e211fe797a5660c54df20 (diff) |
From Mark Lewis:
The current RTP/MPEG2 Transport Stream dissector has a bug. When both
Adaptation Field and Payload are present in a packet (AFC==3) the
payload is ignored and Wireshark marks the packet as malformed.
This patch to epan/dissectors/packet-mp2t.c fixes the problem.
svn path=/trunk/; revision=20910
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-mp2t.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/epan/dissectors/packet-mp2t.c b/epan/dissectors/packet-mp2t.c index f9160177d0..c8dd476c5a 100644 --- a/epan/dissectors/packet-mp2t.c +++ b/epan/dissectors/packet-mp2t.c @@ -136,6 +136,7 @@ static int hf_mp2t_af_e_dnau_14_0 = -1; static int hf_mp2t_af_e_m_3 = -1; static int hf_mp2t_payload = -1; +static int hf_mp2t_malformed_payload = -1; static const value_string mp2t_sync_byte_vals[] = { { 0x47, "Correct" }, @@ -186,6 +187,7 @@ dissect_tsp( tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tre guint32 header; guint afc; gint start_offset = offset; + gint payload_len; proto_item *ti = NULL; proto_item *hi = NULL; @@ -390,11 +392,13 @@ dissect_tsp( tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tre } } - if (afc == 0 || afc == 1) { - gint payload_len; - - payload_len = MP2T_PACKET_SIZE - (offset - start_offset); - if (payload_len > 0) { + payload_len = MP2T_PACKET_SIZE - (offset - start_offset); + if (payload_len > 0) { + if (afc == 2) { /* AF only */ + /* Packet is malformed */ + proto_tree_add_item( mp2t_tree, hf_mp2t_malformed_payload, tvb, offset, payload_len, FALSE); + offset += payload_len; + } else { proto_tree_add_item( mp2t_tree, hf_mp2t_payload, tvb, offset, payload_len, FALSE); offset += payload_len; } @@ -592,6 +596,10 @@ proto_register_mp2t(void) "Payload", "mp2t.payload", FT_BYTES, BASE_DEC, NULL, 0x0, "", HFILL } } , + { &hf_mp2t_malformed_payload, { + "Malformed Payload", "mp2t.malformed_payload", + FT_BYTES, BASE_DEC, NULL, 0x0, "", HFILL + } } , }; static gint *ett[] = |