]> git.sesse.net Git - x264/commitdiff
Fix overflow in stats printing
authorAnton Mitrofanov <BugMaster@narod.ru>
Fri, 3 Sep 2010 15:39:48 +0000 (08:39 -0700)
committerFiona Glaser <fiona@x264.com>
Fri, 3 Sep 2010 15:47:36 +0000 (08:47 -0700)
encoder/encoder.c

index ea55cb1ec178e16fe044ddd3b20230f16d3a5c89..919be0c8d249f26448fe8c363a7dcac6b9fe694f 100644 (file)
@@ -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 */