From e355b0e12d6cb380c13cdce15b42093eb8eeef44 Mon Sep 17 00:00:00 2001 From: Jason Garrett-Glaser Date: Thu, 28 Feb 2013 13:32:37 -0800 Subject: [PATCH] Fix undefined behavior in x264_ratecontrol_mb --- encoder/ratecontrol.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c index 947aeda4..21573018 100644 --- a/encoder/ratecontrol.c +++ b/encoder/ratecontrol.c @@ -1667,7 +1667,8 @@ int x264_ratecontrol_mb( x264_t *h, int bits ) rc->qpm = x264_clip3f( (prev_row_qp + rc->qpm)*0.5f, prev_row_qp + 1.0f, qp_max ); rc->qpa_rc = rc->qpa_rc_prev; rc->qpa_aq = rc->qpa_aq_prev; - h->fdec->i_row_bits[y] = h->fdec->i_row_bits[y-SLICE_MBAFF] = 0; + h->fdec->i_row_bits[y] = 0; + h->fdec->i_row_bits[y-SLICE_MBAFF] = 0; return -1; } } @@ -1683,7 +1684,8 @@ int x264_ratecontrol_mb( x264_t *h, int bits ) rc->qpm = qp_max; rc->qpa_rc = rc->qpa_rc_prev; rc->qpa_aq = rc->qpa_aq_prev; - h->fdec->i_row_bits[y] = h->fdec->i_row_bits[y-SLICE_MBAFF] = 0; + h->fdec->i_row_bits[y] = 0; + h->fdec->i_row_bits[y-SLICE_MBAFF] = 0; return -1; } } -- 2.47.3