]> granicus.if.org Git - libx264/commitdiff
fix some overflows in mp4 timestamps.
authorLoren Merritt <pengvado@videolan.org>
Sat, 24 Dec 2005 20:59:13 +0000 (20:59 +0000)
committerLoren Merritt <pengvado@videolan.org>
Sat, 24 Dec 2005 20:59:13 +0000 (20:59 +0000)
patch by Francesco Corriga.

git-svn-id: svn://svn.videolan.org/x264/trunk@389 df754926-b1dd-0310-bc7b-ec298dee348c

x264.c

diff --git a/x264.c b/x264.c
index 6e72a931b49add4e4752a7d981623767c6f85cfd..58898a4f9ded61391f14acc62a850e047e3fc45d 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -1557,9 +1557,9 @@ static int write_nalu_mp4( hnd_t handle, uint8_t *p_nalu, int i_size )
 static int set_eop_mp4( hnd_t handle, x264_picture_t *p_picture )
 {
     mp4_t *p_mp4 = (mp4_t *)handle;
-    uint32_t dts = p_mp4->i_numframe * p_mp4->i_time_inc;
-    uint32_t pts = p_picture->i_pts;
-    int offset = p_mp4->i_init_delay + pts - dts;
+    uint64_t dts = (uint64_t)p_mp4->i_numframe * p_mp4->i_time_inc;
+    uint64_t pts = (uint64_t)p_picture->i_pts;
+    int32_t offset = p_mp4->i_init_delay + pts - dts;
 
     p_mp4->p_sample->IsRAP = p_picture->i_type == X264_TYPE_IDR ? 1 : 0;
     p_mp4->p_sample->DTS = dts;