avformat/rtpenc: Fix integer overflow in NTP_TO_RTP_FORMAT
authorBoris Nagels <develop@focusware.nl>
Sun, 6 Mar 2016 15:31:36 +0000 (16:31 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 28 Apr 2016 01:47:13 +0000 (03:47 +0200)
commitf00f588a6ed4ad855756f9abf3c67e55ec7cdbc0
tree63bb4ae64ab57e7acf57f34013feffb5edc2e7ea
parentdc92c6045f94a56fcf9bdee5225749809b444a7a
avformat/rtpenc: Fix integer overflow in NTP_TO_RTP_FORMAT

RTCP synchronization packet was broken since commit in ffmpeg version > 2.8.3
(commit: e04b039b1528f4c7df5c2b93865651bfea168a19) Since this commit (2e814d0329aded98c811d0502839618f08642685)
"rtpenc: Simplify code by introducing a macro for rescaling NTP timestamps", NTP_TO_RTP_FORMAT
uses av_rescale_rnd() function to add the data to the packet.

This causes an overflow in the av_rescale_rnd() function and it will return INT64_MIN.
Causing the NTP stamp in the RTCP packet to have an invalid value.

Github: Closes #182

Reverting commit '2e814d0329aded98c811d0502839618f08642685' solves the problem.
(cherry picked from commit 1109ed7973c7fd1e7001898adc4976590d862122)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/rtpenc.c