aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2005-01-14 19:28:02 +0000
committerGuy Harris <guy@alum.mit.edu>2005-01-14 19:28:02 +0000
commit766b213ed682731b366a744093923539ef0f49db (patch)
tree8ebdf71a87f8004af98806b0a6f052703841e92e
parente7fd062619c2261a943c6ae9eae7676bc0d15328 (diff)
If an item in a source description chunk begins with 4 bytes of zero,
that doesn't mean it's padding at the end of a previous item - it might, for example, be the *first* item in the chunk. Don't treat it as padding. Do, however, treat an item that begins with a zero byte as an item, but break out of the loop processing items as soon as the item type is put into the protocol tree, as there's no length field or data in an RTCP_SDES_END item. Fix the comment for that loop to indicate that the loop checks both for end-of-frame and for an RTCP_SDES_END item. svn path=/trunk/; revision=13040
-rw-r--r--epan/dissectors/packet-rtcp.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/epan/dissectors/packet-rtcp.c b/epan/dissectors/packet-rtcp.c
index d29a4b6a77..963423f3af 100644
--- a/epan/dissectors/packet-rtcp.c
+++ b/epan/dissectors/packet-rtcp.c
@@ -633,19 +633,6 @@ dissect_rtcp_sdes( tvbuff_t *tvb, int offset, proto_tree *tree,
start_offset = offset;
ssrc = tvb_get_ntohl( tvb, offset );
- if (ssrc == 0) {
- /* According to RFC1889 section 6.4:
- * "The list of items in each chunk is terminated by one or more
- * null octets, the first of which is interpreted as an item type
- * of zero to denote the end of the list, and the remainder as
- * needed to pad until the next 32-bit boundary.
- *
- * A chunk with zero items (four null octets) is valid but useless."
- */
- proto_tree_add_text(tree, tvb, offset, 4, "Padding");
- offset += 4;
- continue;
- }
sdes_item = proto_tree_add_text(tree, tvb, offset, -1,
"Chunk %u, SSRC/CSRC %u", chunk, ssrc);
sdes_tree = proto_item_add_subtree( sdes_item, ett_sdes );
@@ -663,15 +650,19 @@ dissect_rtcp_sdes( tvbuff_t *tvb, int offset, proto_tree *tree,
/*
* Not every message is ended with "null" bytes, so check for
- * end of frame instead.
+ * end of frame as well.
*/
- while ( ( tvb_reported_length_remaining( tvb, offset ) > 0 )
- && ( tvb_get_guint8( tvb, offset ) != RTCP_SDES_END ) ) {
+ while ( tvb_reported_length_remaining( tvb, offset ) > 0 ) {
/* ID, 8 bits */
sdes_type = tvb_get_guint8( tvb, offset );
proto_tree_add_item( sdes_item_tree, hf_rtcp_ssrc_type, tvb, offset, 1, FALSE );
offset++;
+ if ( sdes_type == RTCP_SDES_END ) {
+ /* End of list */
+ break;
+ }
+
/* Item length, 8 bits */
item_len = tvb_get_guint8( tvb, offset );
proto_tree_add_item( sdes_item_tree, hf_rtcp_ssrc_length, tvb, offset, 1, FALSE );