summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2012-05-04 15:52:30 +0000
committerMark Michelson <mmichelson@digium.com>2012-05-04 15:52:30 +0000
commit404b890f494399bba8bd160098af59d405b81b00 (patch)
tree170ce1a0947e47fec45efcaea6317475cdfd24d7 /res
parentfdf3cd0e2ef0ae84e24adf93639671e6a5096543 (diff)
Fix core FINDING 2, FINDING 3, and FINDING 4 from Coverity's CONSTANT_EXPRESSION_RESULT report.
These three all are in RTP code that attempts to print the number of sequence number cycles in an RTCP RR report. The code was masking out the upper 16 bits and then shifting the number right by 16 bits. This led to an all zero result in all cases. The fix is to do the shift without the bit masking. (issue ASTERISK-19649) ........ Merged revisions 365298 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 365299 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r--res/res_rtp_asterisk.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 1137a7770..62a321147 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -1935,7 +1935,7 @@ static struct ast_frame *ast_rtcp_read(struct ast_rtp_instance *instance)
ast_verbose(" Fraction lost: %ld\n", (((long) ntohl(rtcpheader[i + 1]) & 0xff000000) >> 24));
ast_verbose(" Packets lost so far: %d\n", rtp->rtcp->reported_lost);
ast_verbose(" Highest sequence number: %ld\n", (long) (ntohl(rtcpheader[i + 2]) & 0xffff));
- ast_verbose(" Sequence number cycles: %ld\n", (long) (ntohl(rtcpheader[i + 2]) & 0xffff) >> 16);
+ ast_verbose(" Sequence number cycles: %ld\n", (long) (ntohl(rtcpheader[i + 2])) >> 16);
ast_verbose(" Interarrival jitter: %u\n", rtp->rtcp->reported_jitter);
ast_verbose(" Last SR(our NTP): %lu.%010lu\n",(unsigned long) ntohl(rtcpheader[i + 4]) >> 16,((unsigned long) ntohl(rtcpheader[i + 4]) << 16) * 4096);
ast_verbose(" DLSR: %4.4f (sec)\n",ntohl(rtcpheader[i + 5])/65536.0);
@@ -1962,7 +1962,7 @@ static struct ast_frame *ast_rtcp_read(struct ast_rtp_instance *instance)
(((long) ntohl(rtcpheader[i + 1]) & 0xff000000) >> 24),
rtp->rtcp->reported_lost,
(long) (ntohl(rtcpheader[i + 2]) & 0xffff),
- (long) (ntohl(rtcpheader[i + 2]) & 0xffff) >> 16,
+ (long) (ntohl(rtcpheader[i + 2])) >> 16,
rtp->rtcp->reported_jitter,
(unsigned long) ntohl(rtcpheader[i + 4]) >> 16, ((unsigned long) ntohl(rtcpheader[i + 4]) << 16) * 4096,
ntohl(rtcpheader[i + 5])/65536.0,
@@ -1986,7 +1986,7 @@ static struct ast_frame *ast_rtcp_read(struct ast_rtp_instance *instance)
(((long) ntohl(rtcpheader[i + 1]) & 0xff000000) >> 24),
rtp->rtcp->reported_lost,
(long) (ntohl(rtcpheader[i + 2]) & 0xffff),
- (long) (ntohl(rtcpheader[i + 2]) & 0xffff) >> 16,
+ (long) (ntohl(rtcpheader[i + 2])) >> 16,
rtp->rtcp->reported_jitter,
(unsigned long) ntohl(rtcpheader[i + 4]) >> 16,
((unsigned long) ntohl(rtcpheader[i + 4]) << 16) * 4096,