Fix overread/possible crash with intra refresh + VBV
authorAnton Mitrofanov <BugMaster@narod.ru>
Mon, 16 Jan 2012 22:02:53 +0000 (14:02 -0800)
committerJason Garrett-Glaser <jason@x264.com>
Sat, 4 Feb 2012 15:16:19 +0000 (07:16 -0800)
encoder/encoder.c

index 7d0b557..21f3198 100644 (file)
@@ -2899,7 +2899,10 @@ int     x264_encoder_encode( x264_t *h,
             h->fdec->i_pir_end_col = h->fdec->f_pir_position+0.5;
             /* If our intra refresh has reached the right side of the frame, we're done. */
             if( h->fdec->i_pir_end_col >= h->mb.i_mb_width - 1 )
+            {
                 h->fdec->f_pir_position = h->mb.i_mb_width;
+                h->fdec->i_pir_end_col = h->mb.i_mb_width - 1;
+            }
         }
     }