aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rtcp.c
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2017-04-18 23:24:23 +0200
committerMichael Mann <mmann78@netscape.net>2017-04-19 01:04:56 +0000
commit05140af874e9bd86160659dbc8541373d662e290 (patch)
tree1ff3586a27d99ef6ec5b15298d8282bceadb5e5a /epan/dissectors/packet-rtcp.c
parentfe003f1321ba1aec5a66859ca60352f33019ca50 (diff)
RTCP: Handle large TMMBR value presentation
TMMBR can be _very_ large (131072*2^63, larger than 64 bit entities can hold). Therefore don't try to calculate and present the bitrate as an integer value, but as an expression. Bug: 13611 Change-Id: Ieb8caae5d72d06f82c134eda63f99575218584c2 Reviewed-on: https://code.wireshark.org/review/21207 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-rtcp.c')
-rw-r--r--epan/dissectors/packet-rtcp.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/epan/dissectors/packet-rtcp.c b/epan/dissectors/packet-rtcp.c
index 7106979f64..1632778724 100644
--- a/epan/dissectors/packet-rtcp.c
+++ b/epan/dissectors/packet-rtcp.c
@@ -894,9 +894,8 @@ dissect_rtcp_nack( tvbuff_t *tvb, int offset, proto_tree *tree )
static int
dissect_rtcp_rtpfb_tmmbr( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, proto_item *top_item, int num_fci, int is_notification)
{
- int bitrate;
- int exp;
- guint32 mantissa;
+ guint8 exp;
+ guint32 mantissa;
proto_tree *fci_tree;
if (is_notification == 1) {
@@ -911,18 +910,17 @@ dissect_rtcp_rtpfb_tmmbr( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, prot
/* Exp 6 bit*/
proto_tree_add_item( fci_tree, hf_rtcp_rtpfb_tmbbr_fci_exp, tvb, offset, 1, ENC_BIG_ENDIAN );
exp = (tvb_get_guint8(tvb, offset) & 0xfc) >> 2;
- /* Mantissa 17 bit*/
+ /* Mantissa 17 bit*/
proto_tree_add_item( fci_tree, hf_rtcp_rtpfb_tmbbr_fci_mantissa, tvb, offset, 3, ENC_BIG_ENDIAN );
mantissa = (tvb_get_ntohl( tvb, offset) & 0x3fffe00) >> 9;
- bitrate = mantissa << exp;
- proto_tree_add_string_format_value( fci_tree, hf_rtcp_rtpfb_tmbbr_fci_bitrate, tvb, offset, 3, "", "%u", bitrate);
+ proto_tree_add_string_format_value( fci_tree, hf_rtcp_rtpfb_tmbbr_fci_bitrate, tvb, offset, 3, "", "%u*2^%u", mantissa, exp);
offset += 3;
/* Overhead */
proto_tree_add_item( fci_tree, hf_rtcp_rtpfb_tmbbr_fci_measuredoverhead, tvb, offset, 1, ENC_BIG_ENDIAN );
offset += 1;
if (top_item != NULL) {
- proto_item_append_text(top_item, ": TMMBR: %u", bitrate);
+ proto_item_append_text(top_item, ": TMMBR: %u*2^%u", mantissa, exp);
}
return offset;