[Live-devel] Possible arithmetic overflow?

Doug Porter dsp at exacq.com
Wed Mar 10 14:11:04 PST 2010


Jeremy Noring <jnoring at logitech.com> writes:
> 
> In RTPSink.cpp,
> 
>   unsigned lastReceivedTimeNTP
>     = (unsigned)((lastReceivedTimeNTP_high<<16) + fractionalPart + 0.5);
> 
> A 32-bit value is shifted, then cast to 64-bit value (this is
> because of the parenthesis); I'm not sure if
> lastReceivedTimeNTP_high gets large enough for this to be an
> issue, or if this is intended?

The round-trip delay would have to be larger than the period of
overflow (2^16 s) for this to be a problem.

-- 
dsp


More information about the live-devel mailing list