ref: 0a3593a55571e2ceca45fece9b7f7430a0cc3304
parent: 0c602827863e51a6f26bd7094e320a41cea078ae
parent: 9b24251c9139f5f5213a4a0e94c33ad57fb20617
author: Marco Paniconi <[email protected]>
date: Mon Feb 1 10:18:16 EST 2016
Merge "vp9-noise estimate: Put check to avoid possible out of bounds."
--- a/vp9/encoder/vp9_noise_estimate.c
+++ b/vp9/encoder/vp9_noise_estimate.c
@@ -162,7 +162,9 @@
for (mi_row = 0; mi_row < cm->mi_rows; mi_row++) {
for (mi_col = 0; mi_col < cm->mi_cols; mi_col++) {
// 16x16 blocks, 1/4 sample of frame.
- if (mi_row % 4 == 0 && mi_col % 4 == 0) {
+ if (mi_row % 4 == 0 && mi_col % 4 == 0 &&
+ mi_row < cm->mi_rows - 1 &&
+ mi_col < cm->mi_cols - 1) {
int bl_index = mi_row * cm->mi_cols + mi_col;
int bl_index1 = bl_index + 1;
int bl_index2 = bl_index + cm->mi_cols;