[x264-devel] [PATCH] Fix index out-of-bound
Vitaly Buka
vitalybuka at google.com
Wed Apr 15 08:11:27 UTC 2020
From: Vitaly Buka <vitalybuka at gmail.com>
rcc->last_non_b_pict_type can be -1 in cases when last_non_b_q even
not used.
---
encoder/ratecontrol.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c
index 1598b508..fa461980 100644
--- a/encoder/ratecontrol.c
+++ b/encoder/ratecontrol.c
@@ -7,7 +7,7 @@
* Michael Niedermayer <michaelni at gmx.at>
* Gabriel Bouvigne <gabriel.bouvigne at joost.com>
* Fiona Glaser <fiona at x264.com>
- * M�ns Rullg�rd <mru at mru.ath.cx>
+ * M�ns Rullg�rd <mru at mru.ath.cx>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -2031,7 +2031,6 @@ static double get_diff_limited_q(x264_t *h, ratecontrol_entry_t *rce, double q,
// force I/B quants as a function of P quants
const double last_p_q = rcc->last_qscale_for[SLICE_TYPE_P];
- const double last_non_b_q= rcc->last_qscale_for[rcc->last_non_b_pict_type];
if( pict_type == SLICE_TYPE_I )
{
double iq = q;
@@ -2050,7 +2049,7 @@ static double get_diff_limited_q(x264_t *h, ratecontrol_entry_t *rce, double q,
else if( pict_type == SLICE_TYPE_B )
{
if( h->param.rc.f_pb_factor > 0 )
- q = last_non_b_q;
+ q = rcc->last_qscale_for[rcc->last_non_b_pict_type];
if( !rce->kept_as_ref )
q *= fabs( h->param.rc.f_pb_factor );
}
--
2.26.0.110.g2183baf09c-goog
More information about the x264-devel
mailing list