diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-09-08 14:49:53 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-09-08 21:51:25 +0000 |
commit | 7143bd72f9bc47f40f07763a9ef32459eaa5b311 (patch) | |
tree | 94735a60ffcaeb09cbedb362c1a133e90bc7b5f1 | |
parent | 4af01a8f30722e969046ab3cd7a1e3e3e4e3d69e (diff) |
Do the PCR and the original PCR the same way.
In both cases, make the extension a 16-bit variable, cast the result of
extracting the extension to guint16 to clarify that only the 9 bits
visible through the mask matter.
While we're at it, there's no need to use
"proto_tree_add_uint64_format_value() if the format is just the standard
format for a 64-bit unsigned integer.
Change-Id: I8f1f48595830d4672984f3797be1c9d994e64ea0
Reviewed-on: https://code.wireshark.org/review/4043
Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r-- | epan/dissectors/packet-mp2t.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/epan/dissectors/packet-mp2t.c b/epan/dissectors/packet-mp2t.c index fa819df890..f1d83795a9 100644 --- a/epan/dissectors/packet-mp2t.c +++ b/epan/dissectors/packet-mp2t.c @@ -976,24 +976,23 @@ dissect_mp2t_adaptation_field(tvbuff_t *tvb, gint offset, proto_tree *tree) /* 33 bit PCR base, 6 bit reserved, 9 bit PCR ext */ pcr_base = tvb_get_ntoh48(tvb, offset) >> (48-33); - pcr_ext = tvb_get_ntoh48(tvb, offset) & 0x1FF; + pcr_ext = (guint16)(tvb_get_ntoh48(tvb, offset) & 0x1FF); - proto_tree_add_uint64_format_value(mp2t_af_tree, hf_mp2t_af_pcr, tvb, offset, 6, - pcr_base*300 + pcr_ext, "%" G_GINT64_MODIFIER "u", pcr_base*300 + pcr_ext); + proto_tree_add_uint64(mp2t_af_tree, hf_mp2t_af_pcr, tvb, offset, 6, + pcr_base*300 + pcr_ext); offset += 6; } if (af_flags & MP2T_AF_OPCR_MASK) { guint64 opcr_base; - guint32 opcr_ext; + guint16 opcr_ext; /* the same format as PCR above */ opcr_base = tvb_get_ntoh48(tvb, offset) >> (48-33); - opcr_ext = tvb_get_ntoh48(tvb, offset) & 0x1FF; + opcr_ext = (guint16)(tvb_get_ntoh48(tvb, offset) & 0x1FF); - proto_tree_add_uint64_format_value(mp2t_af_tree, hf_mp2t_af_opcr, tvb, offset, 6, - opcr_base*300 + opcr_ext, "%" G_GINT64_MODIFIER "u", + proto_tree_add_uint64(mp2t_af_tree, hf_mp2t_af_opcr, tvb, offset, 6, opcr_base*300 + opcr_ext); offset += 6; |