[FFmpeg-cvslog] libavformat/rtpdec: fix issue with conversion from unsigned to signed

Gilles Chanteperdrix git at videolan.org
Sat Feb 21 14:34:33 CET 2015


ffmpeg | branch: master | Gilles Chanteperdrix <gilles.chanteperdrix at xenomai.org> | Fri Feb 20 07:14:53 2015 +0100| [73029abddc14c8a376ff81968fe9b1e171e4e9eb] | committer: Michael Niedermayer

libavformat/rtpdec: fix issue with conversion from unsigned to signed

When receiving an RTCP packet, the difference between the last RTCP
timestamp and the base timestamp may be negative. As these timestamps
are of the uint32_t type, the result becomes a large integer. Cast
the difference to int32_t to avoid this issue.

The result of this issue is very large start times for RTSP
streams, and difficulty to restart correctly after a pause.

Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix at xenomai.org>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=73029abddc14c8a376ff81968fe9b1e171e4e9eb
---

 libavformat/rtpdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 1866bda..b4637e2 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -161,7 +161,7 @@ static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf,
                 s->first_rtcp_ntp_time = s->last_rtcp_ntp_time;
                 if (!s->base_timestamp)
                     s->base_timestamp = s->last_rtcp_timestamp;
-                s->rtcp_ts_offset = s->last_rtcp_timestamp - s->base_timestamp;
+                s->rtcp_ts_offset = (int32_t)(s->last_rtcp_timestamp - s->base_timestamp);
             }
 
             break;



More information about the ffmpeg-cvslog mailing list