[x264-devel] commit: Fix overflow in stats printing (Anton Mitrofanov )

git at videolan.org git at videolan.org
Sat Sep 4 01:24:49 CEST 2010


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Fri Sep  3 08:39:48 2010 -0700| [d55fc72d55685312939497734a3516142da62e98] | committer: Jason Garrett-Glaser 

Fix overflow in stats printing

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=d55fc72d55685312939497734a3516142da62e98
---

 encoder/encoder.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/encoder/encoder.c b/encoder/encoder.c
index f5fe2c5..f06c4de 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -3073,7 +3073,7 @@ void    x264_encoder_close  ( x264_t *h )
         const int i_count = h->stat.i_frame_count[SLICE_TYPE_I] +
                             h->stat.i_frame_count[SLICE_TYPE_P] +
                             h->stat.i_frame_count[SLICE_TYPE_B];
-        int64_t i_mb_count = i_count * h->mb.i_mb_count;
+        int64_t i_mb_count = (int64_t)i_count * h->mb.i_mb_count;
         float fps = (float) h->param.i_fps_num / h->param.i_fps_den;
         float f_bitrate;
         /* duration algorithm fails with one frame */



More information about the x264-devel mailing list