[x264-devel] commit: Fix a very rare integer overflow in slicetype analysis ( Jason Garrett-Glaser )

git version control git at videolan.org
Tue Oct 13 03:49:22 CEST 2009


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Mon Oct 12 15:38:51 2009 -0700| [b47aca5ed2797b8b46a0bd83d58ffdb60dffc1ef] | committer: Jason Garrett-Glaser 

Fix a very rare integer overflow in slicetype analysis
Caused an assert failure when it occurred.
Bug is as old as adaptive B-frames.

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

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

diff --git a/encoder/slicetype.c b/encoder/slicetype.c
index d27a057..8183ae4 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;
 



More information about the x264-devel mailing list