]> git.videolan.org Git - x264.git/commitdiff
Fix a very rare integer overflow in slicetype analysis
authorJason Garrett-Glaser <darkshikari@gmail.com>
Mon, 12 Oct 2009 22:38:51 +0000 (15:38 -0700)
committerJason Garrett-Glaser <darkshikari@gmail.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 d27a057391f627f6db1173a713bac7cbff9bb515..8183ae46906e38dbe342a7cb21b637b2325ae513 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;