[FFmpeg-cvslog] v4l2_m2m: Fix integer overflow in timestamp handling

Mark Thompson git at videolan.org
Mon Jan 22 18:27:32 EET 2018


ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Sun Jan 21 00:52:18 2018 +0000| [2e96f5278095d44f090a4d89507e62d27cccf3b9] | committer: Jorge Ramirez-Ortiz

v4l2_m2m: Fix integer overflow in timestamp handling

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

 libavcodec/v4l2_buffers.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c
index 8e4d4d1c9f..aef911f3bb 100644
--- a/libavcodec/v4l2_buffers.c
+++ b/libavcodec/v4l2_buffers.c
@@ -69,7 +69,8 @@ static inline uint64_t v4l2_get_pts(V4L2Buffer *avbuf)
     int64_t v4l2_pts;
 
     /* convert pts back to encoder timebase */
-    v4l2_pts = avbuf->buf.timestamp.tv_sec * USEC_PER_SEC + avbuf->buf.timestamp.tv_usec;
+    v4l2_pts = (int64_t)avbuf->buf.timestamp.tv_sec * USEC_PER_SEC +
+                        avbuf->buf.timestamp.tv_usec;
 
     return av_rescale_q(v4l2_pts, v4l2_timebase, s->avctx->time_base);
 }



More information about the ffmpeg-cvslog mailing list