[x264-devel] commit: Fix potential infinite loop in VBV under GCC 4.2 (Gabriel Bouvigne )

git version control git at videolan.org
Wed Nov 5 03:37:43 CET 2008


x264 | branch: master | Gabriel Bouvigne <bouvigne at mp3-tech.org> | Tue Nov  4 09:56:03 2008 -0800| [b4b113c5955e95d20f4965b6ba3e34643f4aeb2e] | committer: Jason Garrett-Glaser 

Fix potential infinite loop in VBV under GCC 4.2

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

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

diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c
index 2d75471..876551f 100644
--- a/encoder/ratecontrol.c
+++ b/encoder/ratecontrol.c
@@ -1709,7 +1709,7 @@ static void vbv_pass2( x264_t *h )
             adj_max = fix_underflow(h, t0, t1, 1.001, qscale_min, qscale_max);
 
         expected_bits = count_expected_bits(h);
-    } while(expected_bits < .995 * all_available_bits && expected_bits > prev_bits);
+    } while((expected_bits < .995*all_available_bits) && ((int)(expected_bits+.5) > (int)(prev_bits+.5)) );
 
     if (!adj_max)
         x264_log( h, X264_LOG_WARNING, "vbv-maxrate issue, qpmax or vbv-maxrate too low\n");



More information about the x264-devel mailing list