Overflow in pj_math_stat_update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,
 Inside fuction pj_math_stat_update,calling from pjmedia_rtcp_xr_rx_rtp is
leading to overflow in mean calculation, as jitter value is less than mean
value & delta comes out to be in minus value.

   delta = val - stat->mean; {leads to minus value, coz while setting we
make it divide by 16 in this code

#if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0)
        pjmedia_rtcp_xr_rx_rtp(&sess->xr_session, seq,
                   0,                /* lost    */
                   0,                /* dup     */
                   discarded,            /* discard */
                   (sess->jitter >> 4),        /* jitter  */
                   -1, 0);            /* toh     */
#endif

}
This all leads to some overflow value in int variable, leading wrong
results.
Regards
Ravi Inder Singh

-- 
Thanks & Regards,
Ravi Inder Singh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080722/546df847/attachment.html 


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux