]> granicus.if.org Git - libx264/commitdiff
Fix a very rare integer overflow in slicetype analysis
authorFiona Glaser <fiona@x264.com>
Mon, 12 Oct 2009 22:38:51 +0000 (15:38 -0700)
committerFiona Glaser <fiona@x264.com>
Tue, 13 Oct 2009 01:45:29 +0000 (18:45 -0700)
Caused an assert failure when it occurred.
Bug is as old as adaptive B-frames.

encoder/slicetype.c

index e4bd005290c423b3aa4e6e31dada9ac94cbb7ff3..48d70dc1124cde83ec3a0b8f7ac0c8aa1de6f3d3 100644 (file)
@@ -349,7 +349,7 @@ static int x264_slicetype_frame_cost( x264_t *h, x264_mb_analysis_t *a,
         }
 
         if( b != p1 )
-            i_score = i_score * 100 / (120 + h->param.i_bframe_bias);
+            i_score = (uint64_t)i_score * 100 / (120 + h->param.i_bframe_bias);
         else
             frames[b]->b_intra_calculated = 1;