mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/rtpenc: Fix integer overflow in NTP_TO_RTP_FORMAT
RTCP synchronization packet was broken since commit in ffmpeg version > 2.8.3 (commit:e04b039b15
) Since this commit (2e814d0329
) "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 commit1109ed7973
) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
212acaee63
commit
79d9680c7b
|
@ -282,7 +282,8 @@ static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time, int bye)
|
|||
avio_w8(s1->pb, RTCP_SR);
|
||||
avio_wb16(s1->pb, 6); /* length in words - 1 */
|
||||
avio_wb32(s1->pb, s->ssrc);
|
||||
avio_wb64(s1->pb, NTP_TO_RTP_FORMAT(ntp_time));
|
||||
avio_wb32(s1->pb, ntp_time / 1000000);
|
||||
avio_wb32(s1->pb, ((ntp_time % 1000000) << 32) / 1000000);
|
||||
avio_wb32(s1->pb, rtp_ts);
|
||||
avio_wb32(s1->pb, s->packet_count);
|
||||
avio_wb32(s1->pb, s->octet_count);
|
||||
|
|
Loading…
Reference in New Issue