aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mp2t.c
diff options
context:
space:
mode:
authorsfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>2007-02-23 21:31:11 +0000
committersfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>2007-02-23 21:31:11 +0000
commit222da2e3cbf1f63c93440ca8cf2e95760baa14f7 (patch)
tree082a144474bb4af9505e5fb9a6afc871033fd6fc /epan/dissectors/packet-mp2t.c
parente415ad77d3ee6446f3fe9e5702eab8de93f576a3 (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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@20910 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-mp2t.c')
-rw-r--r--epan/dissectors/packet-mp2t.c18
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[] =