]> git.videolan.org Git - x264.git/commitdiff
Fix undefined behavior in x264_ratecontrol_mb
authorJason Garrett-Glaser <jason@x264.com>
Thu, 28 Feb 2013 21:32:37 +0000 (13:32 -0800)
committerJason Garrett-Glaser <jason@x264.com>
Sat, 13 Apr 2013 17:36:24 +0000 (10:36 -0700)
encoder/ratecontrol.c

index 947aeda48402645003a4ee3622d8d69d4cbb0e02..2157301804ca1df8a701e659bc87ab10f182edff 100644 (file)
@@ -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;
         }
     }