aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mpeg-pes.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2009-04-30 15:57:05 +0000
committerAnders Broman <anders.broman@ericsson.com>2009-04-30 15:57:05 +0000
commitd27b5bd9ba96b12d3183181b4a9a5b5beb1b1815 (patch)
tree4fb589a069dea533787fad8096210432bd0decf0 /epan/dissectors/packet-mpeg-pes.c
parentd75f0bc4aa3513b3e3af2e4aca70a3b2fdd7d56e (diff)
Fix:
"This is due to a bug in the sourcecode of the MPEG-PES dissector. It originates in r26328, which added a bugfix to the generated code with the use of 'illegal' characters in the comment block. Currently the bugfix is dropped since it was never added to the ASN.1 dissector template, hence has been lost with the new generation of this code." svn path=/trunk/; revision=28201
Diffstat (limited to 'epan/dissectors/packet-mpeg-pes.c')
-rw-r--r--epan/dissectors/packet-mpeg-pes.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/epan/dissectors/packet-mpeg-pes.c b/epan/dissectors/packet-mpeg-pes.c
index 0916e0a516..9475101db1 100644
--- a/epan/dissectors/packet-mpeg-pes.c
+++ b/epan/dissectors/packet-mpeg-pes.c
@@ -848,7 +848,15 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = dissect_mpeg_pes_Stream(tvb, offset, &asn1_ctx,
tree, hf_mpeg_pes_extension);
- length -= 5 * 8;
+ /* https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2229
+ * A value of 0 indicates that the PES packet length is neither specified nor
+ * bounded and is allowed only in PES packets whose payload is a video elementary
+ * stream contained in Transport Stream packets.
+ * XXX Some one with access to the spec should check this
+ */
+ if(length !=0 && stream != STREAM_VIDEO){
+ length -= 5 * 8;
+ }
header_length = tvb_get_guint8(tvb, 8);
if (header_length > 0) {
@@ -857,7 +865,16 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
header_length, header_length);
dissect_mpeg_pes_header_data(header_data, pinfo, tree, flags);
offset += header_length * 8;
- length -= header_length * 8;
+ /* lenght may be zero for Video stream */
+ if(length !=0 && stream != STREAM_VIDEO){
+ length -= header_length * 8;
+ }
+ }
+
+ /* lenght may be zero for Video stream */
+ if(length==0){
+ proto_tree_add_item(tree, hf_mpeg_pes_data, tvb, (offset>>3),-1, FALSE);
+ return TRUE;
}
es = tvb_new_subset(tvb, offset / 8, -1, length / 8);
@@ -1108,7 +1125,7 @@ proto_register_mpeg_pes(void)
"mpeg_pes.BIT_STRING_SIZE_16", HFILL }},
/*--- End of included file: packet-mpeg-pes-hfarr.c ---*/
-#line 466 "packet-mpeg-pes-template.c"
+#line 483 "packet-mpeg-pes-template.c"
{ &hf_mpeg_pes_pack_header,
{ "Pack header", "mpeg-pes.pack",
FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
@@ -1204,7 +1221,7 @@ proto_register_mpeg_pes(void)
&ett_mpeg_pes_Picture,
/*--- End of included file: packet-mpeg-pes-ettarr.c ---*/
-#line 551 "packet-mpeg-pes-template.c"
+#line 568 "packet-mpeg-pes-template.c"
&ett_mpeg_pes_pack_header,
&ett_mpeg_pes_header_data,
};