From: Fiona Glaser Date: Mon, 12 Oct 2009 22:38:51 +0000 (-0700) Subject: Fix a very rare integer overflow in slicetype analysis X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d421ce5d657cdd8e200ac003cbfcffb45d6a388d;p=libx264 Fix a very rare integer overflow in slicetype analysis Caused an assert failure when it occurred. Bug is as old as adaptive B-frames. --- diff --git a/encoder/slicetype.c b/encoder/slicetype.c index e4bd0052..48d70dc1 100644 --- a/encoder/slicetype.c +++ b/encoder/slicetype.c @@ -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;