From d27b5bd9ba96b12d3183181b4a9a5b5beb1b1815 Mon Sep 17 00:00:00 2001 From: Anders Broman Date: Thu, 30 Apr 2009 15:57:05 +0000 Subject: 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 --- asn1/mpeg-pes/Makefile.nmake | 4 ++++ asn1/mpeg-pes/packet-mpeg-pes-template.c | 21 +++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'asn1/mpeg-pes') diff --git a/asn1/mpeg-pes/Makefile.nmake b/asn1/mpeg-pes/Makefile.nmake index 5a32997c60..6aa21c4986 100644 --- a/asn1/mpeg-pes/Makefile.nmake +++ b/asn1/mpeg-pes/Makefile.nmake @@ -27,3 +27,7 @@ include ../Makefile.preinc.nmake include Makefile.common include ../Makefile.inc.nmake +checkapi: + $(PERL) ../../tools/checkAPIs.pl \ + $(PROTOCOL_NAME).cnf \ + packet-$(PROTOCOL_NAME)-template.c \ No newline at end of file diff --git a/asn1/mpeg-pes/packet-mpeg-pes-template.c b/asn1/mpeg-pes/packet-mpeg-pes-template.c index d9bb6e3c6f..91bf85ced3 100644 --- a/asn1/mpeg-pes/packet-mpeg-pes-template.c +++ b/asn1/mpeg-pes/packet-mpeg-pes-template.c @@ -407,7 +407,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) { @@ -416,7 +424,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); -- cgit v1.2.3